Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions fern/products/sdks/generators/typescript/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,22 @@ const client = new BarClient({...});
Subpackage exports are also documented in the generated `README.md` when this option is enabled.
</ParamField>

<ParamField path="guardProcessEnvAccess" type="boolean" default="false" toc={true}>
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: <Markdown src="/snippets/version-number-ts.mdx"/>
config:
guardProcessEnvAccess: true
```
</ParamField>

<ParamField path="includeContentHeadersOnFileDownloadResponse" type="boolean" toc={true}>

Includes the content type and content length from binary responses. The user will receive an object of the following type:
Expand Down
Loading