From 9dc74d79c4e54ad7d85a40318fd336509811e501 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 4 Sep 2026 17:05:34 +0000 Subject: [PATCH] docs(typescript): document guardProcessEnvAccess Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../sdks/generators/typescript/configuration.mdx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fern/products/sdks/generators/typescript/configuration.mdx b/fern/products/sdks/generators/typescript/configuration.mdx index 71084cadd2..c880cbeb00 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: