This section details the available configuration options for the TypeScript SDK. All configuration is managed in the gen.yaml file under the typescript section.
Sets the module format to use when compiling the SDK. Options:
,
, or
. New SDKs default to
for modern module resolution. Existing SDKs default to
for backward compatibility.
legacyFileNaming
false
false (new SDKs)
When
, uses legacy file naming (camelCase/lowercase). When
, uses kebab-case (e.g.,
). New SDKs default to
(kebab-case).
Performance optimization
For optimal bundle size and tree-shaking performance in modern applications, consider using moduleFormat: "esm" together with useIndexModules: false. This combination provides the best possible bundler optimizations. Use dual if CommonJS compatibility is required.
are preserved exactly as written, with only illegal character sanitization applied. No PascalCase or other casing transformations are performed. Only affects enums with
overrides.
Default
false
Type
boolean
clientServerStatusCodesAsErrors
Description
Treats
and
status codes as errors. Set to
to treat them as normal responses.
Default
true
Type
boolean
defaultErrorName
Description
The name of the fallback error class if no more specific error class is matched. Must start with a capital letter and contain only letters and numbers.
Default
SDKError
Type
string
baseErrorName
Description
The name of the base error class used for HTTP error responses. Must start with a capital letter and contain only letters and numbers.
Default
HTTPError
Type
string
acceptHeaderEnum
Description
Whether to generate TypeScript enums for controlling the return content type of SDK methods when multiple accept types are available.
are preserved exactly as written, with only illegal character sanitization applied. No PascalCase or other casing transformations are performed. Only affects enums with
overrides.
boolean
false
clientServerStatusCodesAsErrors
Treats
and
status codes as errors. Set to
to treat them as normal responses.
boolean
true
defaultErrorName
The name of the fallback error class if no more specific error class is matched. Must start with a capital letter and contain only letters and numbers.
string
SDKError
baseErrorName
The name of the base error class used for HTTP error responses. Must start with a capital letter and contain only letters and numbers.
string
HTTPError
acceptHeaderEnum
Whether to generate TypeScript enums for controlling the return content type of SDK methods when multiple accept types are available.
These options control how the SDK handles API evolution, allowing older SDK versions to continue working when APIs add new enum values, union types, or fields.
typescript:
forwardCompatibleEnumsByDefault: true
forwardCompatibleUnionsByDefault: tagged-only
Property
forwardCompatibleEnumsByDefault
Description
Controls whether enums used in responses are treated as open enums that accept unknown values. When
, SDKs gracefully handle new enum values added by the API instead of rejecting the response. Individual enums can be controlled with
or
in the OpenAPI spec.
Default
true
Type
boolean
forwardCompatibleUnionsByDefault
Description
Controls whether discriminated unions accept unknown discriminator values. When set to
, SDKs capture unknown union variants in a type-safe way instead of failing deserialization. Individual unions can be controlled with
or
in the OpenAPI spec.
Default
tagged-only
Type
string
Property
Description
Type
Default
forwardCompatibleEnumsByDefault
Controls whether enums used in responses are treated as open enums that accept unknown values. When
, SDKs gracefully handle new enum values added by the API instead of rejecting the response. Individual enums can be controlled with
or
in the OpenAPI spec.
boolean
true
forwardCompatibleUnionsByDefault
Controls whether discriminated unions accept unknown discriminator values. When set to
, SDKs capture unknown union variants in a type-safe way instead of failing deserialization. Individual unions can be controlled with
or
in the OpenAPI spec.
string
tagged-only
Forward compatibility and fault tolerance
These options work together with laxMode and unionStrategy to provide robust forward compatibility. When all four features are enabled (the default for new TypeScript SDKs), your SDK will gracefully handle API evolution including new enum values, new union types, missing fields, and type mismatches. See the forward compatibility guide for more details.
These options update the TypeScript SDK build toolchain to use faster, modern build tools. Enabling both options can speed up generation time by up to 35% in GitHub Actions and locally.
typescript:
useOxlint: true
useTsgo: true
Property
useOxlint
Description
Replace ESLint with OxLint, a Rust-based linter that is 50-100x faster. When enabled, the generated SDK uses OxLint for linting instead of ESLint, significantly reducing lint times in CI and local development.
Default
true (new SDKs), false (existing SDKs)
Type
boolean
useTsgo
Description
Replace the standard TypeScript compiler (
) with TSGo, Microsoft's native Go-based TypeScript compiler. When enabled, the generated SDK uses TSGo for type checking and compilation, delivering up to 10x faster build times with lower memory usage.
Default
true (new SDKs), false (existing SDKs)
Type
boolean
Property
Description
Type
Default
useOxlint
Replace ESLint with OxLint, a Rust-based linter that is 50-100x faster. When enabled, the generated SDK uses OxLint for linting instead of ESLint, significantly reducing lint times in CI and local development.
boolean
true (new SDKs), false (existing SDKs)
useTsgo
Replace the standard TypeScript compiler (
) with TSGo, Microsoft's native Go-based TypeScript compiler. When enabled, the generated SDK uses TSGo for type checking and compilation, delivering up to 10x faster build times with lower memory usage.
boolean
true (new SDKs), false (existing SDKs)
Generation speed optimization
For fastest generation times, enable both useOxlint and useTsgo together. OxLint replaces ESLint with a Rust-based linter that processes files in parallel, while TSGo replaces tsc with a native Go compiler that delivers up to 10x faster type checking. Combined, these tools can reduce SDK generation time by up to 35%.