Skip to content

Release: JS/TS SDK 1.0 + accumulated staging changes#153

Merged
MarketDataApp merged 33 commits into
mainfrom
staging
May 29, 2026
Merged

Release: JS/TS SDK 1.0 + accumulated staging changes#153
MarketDataApp merged 33 commits into
mainfrom
staging

Conversation

@MarketDataApp

Copy link
Copy Markdown
Owner

Summary

Promotes everything currently on staging to production. The headline is the JavaScript/TypeScript SDK 1.0 launch (@marketdata/sdk); a batch of unrelated staging changes also ride along per the standard staging → main flow.

JavaScript / TypeScript SDK 1.0

  • New SDK docs under sdk/js/ — installation, client, authentication, settings, and per-endpoint pages for stocks, options, funds, markets, utilities
  • JS SDK card added to the main sdk/ index, with javascript-logo.svg + typescript-logo.svg
  • Removed pre-release callouts (no more 0.0.1, no more "install from GitHub"); package is @marketdata/sdk and User-Agent is marketdata-sdk-js/{version}
  • API reference (api/): every NodeJS raw-fetch tab replaced with paired JavaScript + TypeScript tabs using the SDK (docs(api): replace NodeJS raw-fetch tabs with JavaScript + TypeScript… #152)
  • Removed stale "New" badges from Python and PHP SDK cards

Other changes also shipping

  • account/data-freshness.md — new per-endpoint freshness page
  • account/plans/* — minor plan-page tweaks
  • account/plan-limits.md — dropped custom-plan tip
  • account/plans/commercial.mdx — unlisted sales-only page added
  • api/universal-parameters/mode.md — new universal-parameter page
  • api/index.md — surface HTTP 203/204 cache responses
  • worker/ — refactor and shared MDX→MD lib
  • scripts/, lib/, .github/workflows/sync-sdk-docs.yml — SDK docs sync workflow
  • sdk/go/authentication.mdx — stray > fix
  • sdk/sdk-requirements.md — retry policy clarification (3 retries, 1s/2s/4s backoff)

Test plan

  • Verify www-staging.marketdata.app/docs/sdk/js/ renders correctly end-to-end before merge
  • Spot-check www-staging.marketdata.app/docs/api/troubleshooting/real-time-data (largest JS+TS rewrite)
  • Confirm @marketdata/sdk package install instructions render correctly on staging
  • After merge: verify production deploys to www.marketdata.app/docs/sdk/js/
  • Post-deploy integration + e2e tests pass in MarketDataApp/www-marketdata-app orchestrator

MarketDataDev02 and others added 30 commits April 20, 2026 15:32
feat: adds initial documentation for js sdk
Updates every SDK-JS doc under sdk/js/ to reflect the ADR-007 reversal:
public API now surfaces standard Promises. Neverthrow remains internal
to the SDK — callers never see Result types.

Mechanical changes (15 files):
- Import path: `marketdata-sdk-js` → `marketdata-sdk`.
- Type signatures: `MarketDataResult<T>` → `MarketDataPromise<T>`,
  `TypedResult<T,H,P>` → `TypedPromise<T,H,P>`.
- Link anchors: `#MarketDataResult` → `#MarketDataPromise`.
- Example blocks: every `result.match(ok, err)` / `isOk()/value/error`
  / `_unsafeUnwrap()` example rewritten to idiomatic `try/catch`
  around `await`.
- Error handling sections: list the new 7 spec classes
  (Authentication/BadRequest/NotFound/RateLimit/Server/Network/Parse
  + client-side Validation) with cf-ray, status, url, timestamp context.
- 404-as-no-data noted: response.no_data / hasData() patterns.

client.mdx additionally documents:
- `ready: Promise<void>` for eager startup validation
- `skipStartupValidation` config flag for serverless
- 99s request timeout
- Global 50-request concurrency pool
- Utilities resource on the client
- MarketDataPromise response-model methods (isJson/isCsv/isHtml/
  hasData/no_data/saveToFile/save/blob)
- Updated User-Agent to `marketdata-sdk-javascript/{version}`

installation.mdx: `neverthrow` line reworded to note it's now an
internal dep, with a link to the client error-handling section.

No structural rewrites; ADRs under `sdk/js/docs/adr/` intentionally
untouched (historical snapshots).

Verified: grep for `isOk|isErr|ResultAsync|TypedResult|MarketDataResult|
_unsafeUnwrap|.match(|marketdata-sdk-js|unwrap(` under sdk/js/ returns
zero hits outside ADRs.
Adds prominent admonitions on the API root page and Authentication page
warning that any endpoint may return 203 (cached response) instead of
200, since clients that check only status == 200 silently drop valid
cached responses. Adds a Status Codes section to the mode page with the
correct 200/203/204 mapping (203 fires on any cache-layer hit, not
exclusively on mode=cached) and a Python retry example for the 204
cache-miss path. Tracking the matching OpenAPI spec fix in
MarketData-App/api#61.
The plain /contact/ links were being rewritten by Docusaurus to /docs/contact/.
Use absolute URL to point to the WordPress contact form, matching the existing
pattern in api/cors.mdx.
New page at /docs/account/data-freshness explains the freshness model
in three categories — Real-time (<15m), Delayed (15+m, current session),
Historical (15+m, prior session closed) — and clarifies the rollover
rule that's been silently confusing customers and support: stocks roll
to Historical at 4:15 PM ET (close + 15 min), but options roll only at
the *next* session's 9:30 AM ET open. So Friday's options data does
not become Historical until 9:30:01 Monday — a query at 6:33 AM
Wednesday on a Historical-only plan returns Monday's close, not
Tuesday's, and that's correct.

Each plan tier (Free Forever, Starter Trial, Trader Trial, Starter,
Trader, Quant, Prime) gets a per-endpoint freshness table covering
every API endpoint family. Cross-reference links added from the
plan docs, plan-limits, and the universal-parameters/mode page.

A few cells (funds endpoints, UTP-entitled stock candles) are
flagged as pending product confirmation in the page footer.
Adds a shared lib/mdx-to-md.js that the Cloudflare Worker, the new SDK
export CLI, and (eventually) the LLM-bundle script all use for converting
Docusaurus MDX into clean Markdown. Replaces the worker's inline
cleanMarkdown.

Improvements delivered to the live .md serving via the worker:

- Admonitions (:::tip / :::info / :::warning ...) now render as GitHub
  Alert blockquotes (> [!TIP]) instead of passing through unchanged.
- Internal /sdk/, /api/, /img/ links get rewritten to absolute
  www.marketdata.app/docs URLs.
- Code-fence-aware import stripping: imports inside ```typescript fences
  (e.g. `import { MarketDataClient } from "marketdata-sdk-js"`) are no
  longer eaten by the regex. The fix is a proper tokenizer, not a
  patched regex.

Adds:
- lib/mdx-to-md.js — pure CJS, runs in V8 isolates and Node
- lib/__tests__/mdx-to-md.test.js — 33 node --test cases
- scripts/export-sdk-docs.js — `yarn export-sdk-docs --sdk js`
- .github/workflows/sync-sdk-docs.yml — push-to-staging or manual
  dispatch opens a PR in MarketDataApp/sdk-js with regenerated /docs.
  Uses a GitHub App for cross-repo auth; preserves SDK-repo-owned
  content via banner-based selective deletion.

Pilot scope: sdk-js only. Matrix is one-line to extend.
The "<!-- Generated from ... -->" banner was doing two jobs: telling
humans not to edit, and giving the sync workflow a signal to scope
deletion to previously-generated files. Splits those responsibilities:

- Drop the banner from each .md file; titles now start with `# ...`
  directly.
- CLI writes docs/.sync-manifest.txt listing every generated path.
- Workflow reads that manifest to decide what to delete; SDK-repo-owned
  content (ADRs, READMEs not in the manifest) stays untouched.
- PR body now surfaces the "do not edit" notice once, pointing
  reviewers at the manifest.
…gets

Switches directory indices from index.md to README.md so GitHub auto-renders
them at each directory URL, and fixes a real link bug surfaced by the
change: links like [Stocks](/sdk/js/stocks) were rewriting to ./stocks.md
(a file that never existed) instead of the directory landing page.

Mechanism: the export CLI now walks the source tree first, builds a map
{ Docusaurus-subpath → repo-relative output file }, and passes it to
cleanMdx via a new `linkTargets` opt. The lib uses this map to resolve
same-SDK links accurately, and collapses common path prefixes so
siblings get './neighbor.md' rather than '../dir/neighbor.md'.

Worker and LLM-bundle callers don't pass linkTargets — they keep
rewriting same-SDK paths to absolute www.marketdata.app/docs URLs as
before. Five new unit tests cover the directory-index resolution and
prefix collapsing.
Adds the four utilities pages (status, headers, user) plus an options/strikes
reference. Index page updated to list the new namespace alongside stocks/options/
funds/markets. Mirrors the SDK source under sdk-js/src/resources/utilities and
sdk-js/src/resources/options/strikes.ts; documents the constructor-issued
startup user() call and the /user/ 404→NotFoundError carve-out.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the sop/ directory to .gitignore. Internal SOPs are not part of
the public docs site.
Replaces the inline MDX-cleaning logic in generate-master-docs.js with
a call to the shared cleanMdx helper from lib/mdx-to-md, matching the
approach used by the SDK docs sync workflow.

Also adds two package.json scripts:
- export-sdk-docs: produce the SDK docs bundle
- test:lib: run lib/__tests__ via node --test
The malformed value=">MacLinux" broke the worker's MDX→MD TabItem regex,
causing /docs/sdk/go/authentication.md to leak the raw <TabItem> tag and
fail the post-deploy integration test.
Removes sdk/js/options/strikes.mdx after Taylor confirmed the strikes
endpoint will no longer be offered. The options DocCardList is sidebar-
autogenerated and refreshes automatically.

Adds a Quick Start block to sdk/js/index.mdx mirroring the snippet in
the sdk-js README, addressing Santiago's review comment on PR #148.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The chain.mdx Parameters list and Filtered example used snake_case names
(strike_limit, min_open_interest, …) plus days_to_expiration, none of
which the live API recognises — mirroring the SDK schema bug fixed in
sdk-js #19. Rename to the API names: dte, strikeLimit, minBid/maxBid,
minAsk/maxAsk, maxBidAskSpread, maxBidAskSpreadPct, minOpenInterest,
minVolume.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Link UtilitiesResource in the Resources list (parity with the other
  resources, which all link to their per-resource pages).
- Rewrite the NotFoundError row in the Error classes table. The previous
  copy described an internal sentinel (`{s: "no_data"}`) that never
  escapes _makeRequest; the SDK exposes 404 as an empty response with
  `no_data: true`. Also call out the `/user/` opt-in throw path.
- Add PaymentRequiredError (402) and ForbiddenError (403) rows so the
  Error classes table matches the classes actually exported from
  sdk-js src/error.ts on main.
The companion sdk-js change removes client.utilities.user() — its
declared schema never matched the live API response, so callers always
got `{}` at runtime. Rate-limit data is on client.rateLimits (populated
automatically at startup from the same /user/ response headers), and
sdk-py never exposed this surface in the first place.

- Delete sdk/js/utilities/user.mdx
- Rework utilities/index.mdx intro: "All three" -> "Both", drop the
  rate-limit framing on this page, and point readers to
  client.rateLimits for the data the user page used to advertise.
…-strikes

Docs/sdk js utilities and strikes
Line still mentioned the user endpoint after PR #148 removed the page.
docs(sdk/js): drop stale 'user' from utilities resource list
Adds JS and TS logos and a card linking to /sdk/js, matching the layout
of the other SDK cards.
docs(sdk): add JavaScript/TypeScript SDK card to main SDK page
Rename npm package from `marketdata-sdk` to `@marketdata/sdk` across all
JavaScript SDK pages, drop the pre-release callouts, and bump the
User-Agent examples to 1.0.0.
… SDK tabs (#152)

Bring the JS examples across the API reference in line with the other
languages now that the JavaScript/TypeScript SDK (marketdata-sdk) is
shipped. Each affected page's single NodeJS raw-fetch tab is replaced
with paired JavaScript and TypeScript tabs using the SDK (await +
try/catch), sourced from the matching sdk/js/* page.

- 13 endpoint pages: 1:1 SDK swap (stocks/{quotes,prices,candles,
  earnings,news}, options/{chain,expirations,lookup,quotes},
  funds/candles, markets/status, utilities/{status,headers}).
- authentication.mdx: env-var + explicit-token forms.
- troubleshooting/logging.mdx: SDK DefaultLogger(LogLevel.DEBUG).
- troubleshooting/real-time-data.mdx: client.stocks.quotes + Mode.LIVE,
  keeping the data-age diagnostic logic.
- troubleshooting/service-outages.mdx: client.utilities.status().
- stocks/bulkcandles.mdx: SDK has no bulk method yet, so JavaScript
  keeps raw fetch() and TypeScript uses the typed Response API; a note
  documents this until bulk support lands.

Closes #151

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to the JS SDK 1.0 publish: the api/ pages added in #152 used
the pre-release `marketdata-sdk` package name. Swap them to the
published `@marketdata/sdk` so the API reference matches the SDK docs.
The SDK now emits `marketdata-sdk-js/{version}` instead of
`marketdata-sdk-javascript/{version}`. Update the client notes and the
utilities.headers() example to match.
Auto-fix from scripts/fix-table-alignment.js. Resolves the
table-alignment CI check on PR #153.
@MarketDataApp MarketDataApp merged commit 6ea0234 into main May 29, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants