diff --git a/fern/products/sdks/generators/typescript/configuration.mdx b/fern/products/sdks/generators/typescript/configuration.mdx index 71084cadd..c880cbeb0 100644 --- a/fern/products/sdks/generators/typescript/configuration.mdx +++ b/fern/products/sdks/generators/typescript/configuration.mdx @@ -185,6 +185,22 @@ const client = new BarClient({...}); Subpackage exports are also documented in the generated `README.md` when this option is enabled. + +When enabled, the generated auth providers (API key, bearer, basic, and OAuth) only read credential environment variables when a Node `process` global exists. Without the guard, `process.env` reads throw a `ReferenceError` for the undefined `process` global in runtimes such as browsers, Cloudflare Workers, and Deno when a credential isn't passed to the client. With the guard, the client falls through to its standard error asking the caller to provide the credential or set the environment variable. + +Enable this when the SDK runs outside Node.js. Node.js behavior is unchanged, and non-auth headers configured with `env` are unaffected. + +```yml title="generators.yml" +groups: + ts-sdk: + generators: + - name: fern-typescript-sdk + version: + config: + guardProcessEnvAccess: true +``` + + Includes the content type and content length from binary responses. The user will receive an object of the following type: