diff --git a/docs/faq.md b/docs/faq.md index ab237f6a2a..47c5dcad77 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -40,14 +40,14 @@ Once your project is using a single, compatible `zod` version, the `TS2589` erro ### 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** authentication flows used by MCP clients. - **Node.js v19.0.0 and later**: `globalThis.crypto` is available by default. - **Node.js v18.x**: `globalThis.crypto` may not be defined by default. In this repository we polyfill it for tests (see `packages/client/vitest.setup.js`), and you should do the same in your app if it is missing – or alternatively, run Node with `--experimental-global-webcrypto` 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`: ```typescript import { webcrypto } from 'node:crypto';