TypeScript configuration
Configure the TypeScript SDK in the generation block of its target in sdk-config.yml:
The target’s generation block also accepts the shared generation options, such as naming, wireTests, and customCode. Shared options set in the top-level generation block apply to every target, and a target’s generation block overrides them. For generators.yml options, see the Legacy TypeScript configuration.
TypeScript options
typescriptVersion
The TypeScript version used by the generated project.
zodVersion
The Zod version used by generated runtime schemas.
compilerOptions
TypeScript compiler options for the generated project.
compilerOptions.target
The JavaScript language target passed to TypeScript.
compilerOptions.module
The module format passed to TypeScript.
compilerOptions.lib
The runtime library definitions passed to TypeScript.
httpClient
The HTTP client used by generated TypeScript code.
<ParamField path=“httpClient.name” type=""axios” | “fetch"" required= toc=> The HTTP client used by generated TypeScript code. </ParamField>
<ParamField path=“packageManager” type=""pnpm” | “yarn"" required= toc=> The package manager used by the generated project. </ParamField>
packageManagerVersion
The package manager version used by the generated project.
<ParamField path=“testFramework” type=""jest” | “vitest"" required= toc=> The test framework used by generated tests. </ParamField>
<ParamField path=“namingStrategy” type=""base” | “originalPropertyNames"" required= toc=> How schema property names are converted into TypeScript identifiers. </ParamField>
bundle
Whether the generated package includes bundled output.
exportClassDefault
Whether the client class is also exported as the default export.
namespaceExportName
The top-level namespace export name.
consolidateTypeFiles
Whether generated types are consolidated into fewer source files.
allowCustomFetcher
Whether callers can supply a custom fetch implementation.
useBrandedStringAliases
Whether string aliases are emitted as distinct branded types.
useLegacyExports
Whether the package emits the legacy export layout.
useBigInt
Whether 64-bit integer values are represented with bigint.
serdeLayer
Whether generated models use Fern serialization and deserialization helpers.
esmOnly
Whether the package emits only ECMAScript modules.
scripts
Additional scripts added to the generated package manifest.