docs(faq): fix incorrect file references in the Web Crypto answer#2205
Conversation
The "How do I enable Web Crypto" FAQ answer referenced two files by the wrong name: - `packages/client/src/client/auth-extensions.ts` does not exist; the actual file is `packages/client/src/client/authExtensions.ts` (camelCase, no hyphen). - `vitest.setup.ts` does not exist; the polyfill referenced lives at `packages/client/vitest.setup.js`, which the same answer already links correctly two lines above. Corrects both references to the real paths so readers can find the cited code. Docs-only; no package or behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the FAQ entry about enabling Web Crypto in older Node.js versions by correcting internal file references used as examples.
Changes:
- Updates the referenced OAuth auth helper file path to
authExtensions.ts. - Updates the referenced SDK polyfill setup file from
vitest.setup.tstopackages/client/vitest.setup.js.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ### How do I enable Web Crypto (`globalThis.crypto`) for client authentication in older Node.js versions? | ||
|
|
||
| The SDK’s OAuth client authentication helpers (for example, those in `packages/client/src/client/auth-extensions.ts` that use `jose`) rely on the Web Crypto API exposed as `globalThis.crypto`. This is especially important for **client credentials** and **JWT-based** | ||
| The SDK’s OAuth client authentication helpers (for example, those in `packages/client/src/client/authExtensions.ts` that use `jose`) rely on the Web Crypto API exposed as `globalThis.crypto`. This is especially important for **client credentials** and **JWT-based** |
| as per your Node version documentation. (See https://nodejs.org/dist/latest-v18.x/docs/api/globals.html#crypto ) | ||
|
|
||
| If you run clients on Node.js versions where `globalThis.crypto` is missing, you can polyfill it using the built-in `node:crypto` module, similar to the SDK's own `vitest.setup.ts`: | ||
| If you run clients on Node.js versions where `globalThis.crypto` is missing, you can polyfill it using the built-in `node:crypto` module, similar to the SDK's own `packages/client/vitest.setup.js`: |
@modelcontextprotocol/client
@modelcontextprotocol/codemod
@modelcontextprotocol/server
@modelcontextprotocol/express
@modelcontextprotocol/fastify
@modelcontextprotocol/hono
@modelcontextprotocol/node
commit: |
What
Fixes two incorrect file references in the FAQ answer
"How do I enable Web Crypto (
globalThis.crypto) for client authentication in older Node.js versions?" (docs/faq.md).packages/client/src/client/auth-extensions.ts, whichdoes not exist. The actual file is
packages/client/src/client/authExtensions.ts(camelCase, no hyphen) — it'sthe one that imports
joseand implementsprivate_key_jwt/client_credentials, matching the surrounding prose.vitest.setup.ts", but there is no.tssetup file. The polyfill it describes lives atpackages/client/vitest.setup.js— which this same answer already linkscorrectly two lines earlier. The reference now matches.
Why
Both paths were dead links: a reader trying to open the cited source hits a
file that isn't there, which defeats the point of citing it. This corrects them
to the real files.
Scope
Docs-only. Two lines in
docs/faq.md(+2 / -2). No package, runtime, publicAPI, or behavior change; no new dependencies; no changeset needed (top-level
docs change, no published package affected — consistent with other recent
docs(...)PRs).Verification
packages/client/src/client/authExtensions.tsandpackages/client/vitest.setup.jsexist onmain, and the old hyphenated /.tspaths do not.pnpm sync:snippets --checkpasses (the edited lines are prose, notsource=-backed code fences).