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.
allowExtraFields
Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values.
exportAllRequestsAtRoot
Whether every request type is also exported from the package root.
generateSubpackageExports
Whether the package manifest exports each subpackage client as its own entry point.
generateEndpointMetadata
Whether generated clients expose metadata for each endpoint.
includeOtherInUnionTypes
Whether union types gain a member for variants the SDK doesn’t recognize.
includeUtilsOnUnionMembers
Whether helper utilities are generated on each member of a union type.
neverThrowErrors
Whether client methods return a wrapped response instead of throwing on a non-2xx status.
omitFernHeaders
Whether requests omit the SDK identification headers and the User-Agent header.
outputEsm
Whether the package is marked as an ES module while still shipping its CommonJS build.
formDataSupport
The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData.
formatter
The formatter configured in the generated project.
linter
The linter configured in the generated project.
lintStaged
lint-staged commands to run, keyed by file glob.
exports
package.json exports entries, keyed by subpath, applied over the generated exports. Each entry replaces the generated entry for the same subpath.
files
package.json files entries, listed ahead of the generated ones.
engines
package.json engines version ranges, keyed by engine name such as node.
browser
package.json browser field: excludes a module or file (false) or replaces it with another path.
scripts
Additional scripts added to the generated package manifest.