sdk-config.yml configuration schema
Describe the SDK you want, not the generators that build it. You only have to declare shared settings like auth, retries and package details once, and every language target inherits them. Add an SDK in a single line: a new language target. Targets run the newest SDK generators unless you pin generatorVersion.
Already using generators.yml? Follow the SDK Config migration guide to migrate.
The sdk-config.yml file configures SDK generation. It declares the API source, the settings shared by every SDK, and one target per language. Settings at the top level apply to every target; each target can override them.
Projects that still generate from generators.yml can move to sdk-config.yml with fern sdk migrate. The legacy generators.yml reference documents the previous format.
Credentials
Credential fields such as output.publish.token and output.github.credentials don’t accept literal secrets. Use an environment expression such as ${NPM_TOKEN}, which Fern resolves when it generates the SDK.
Paths
Paths in sdk-config.yml are relative to the file. Absolute paths and paths that contain .. segments are rejected.
Override settings per target
A target inherits the top-level sdkName, sdkVersion, client, docs, package, and generation settings and overrides only the fields it sets. A target’s output replaces the top-level output entirely. Every target needs an effective output, either from the top level or from its own block.
schemaVersion
schemaVersion
The version of the SDK Config schema. Set to sdk-config/v1.
sdkName, sdkVersion, and apiVersion
sdkName
The default name used for generated SDKs.
sdkVersion
The default version assigned to generated SDKs.
apiVersion
The version of the API represented by the generated SDKs.
source
The API descriptions used to generate the SDKs. Each entry in specs sets exactly one of path (a local file) or url (an HTTP(S) resource).
source.specs[].id
A unique identifier for this API source.
source.specs[].type
The API description format of this source.
source.specs[].name
A human-readable name for this API source.
source.specs[].namespace
A namespace used to isolate this source in a multi-source SDK.
source.specs[].apiImportSettings
Import behavior that overrides the source-level defaults for this spec.
source.specs[].overlays
Relative paths to overlays applied to this source in order.
source.specs[].overrides
Relative paths to source override files applied in order.
source.specs[].path
The relative path to the API source file.
source.specs[].url
The HTTP or HTTPS URL of the API source file.
source.apiImportSettings
API import settings applied to every spec. A spec’s own apiImportSettings override these values.
api
api.baseUrl
The default base URL used by the generated client.
api.environments
Named API environments and their base URLs.
api.environmentVariables
Environment variables exposed through generated client configuration.
api.defaultEnvironment
The environment selected when a caller doesn’t choose one.
api.auth
Authentication supported by the API.
api.headers
Headers added to generated API requests.
api.audiences
Named API audiences included in the generated SDK.
api.webhookSignature
How generated helpers verify webhook signatures from the API.
client
client.retry
Retry behavior for generated API requests.
client.responseHeaders
Whether generated operations expose HTTP response headers.
client.responseValidation
Whether the client validates API responses against the schema.
client.multiTenant
Whether the client exposes configuration for tenant-specific API access.
client.additionalConstructorParameters
Additional parameters added to the generated client constructor.
client.timeoutMs
The default request timeout in milliseconds, or “infinity” for no timeout.
client.requestParameterStyle
Whether generated operation parameters are wrapped or passed inline.
client.pathParameterStyle
Whether generated path parameters are wrapped or passed inline.
client.filePropertyStyle
Whether generated file properties are wrapped or passed inline.
client.useDefaultRequestParameterValues
Whether schema defaults are applied to omitted request parameters.
client.respectOptionalRequestBody
Whether an optional request body remains optional in generated methods.
client.tokenRefresh
Refresh-token behavior for the generated client.
client.idempotencyKeyGeneration
Automatic idempotency keys on eligible requests.
client.userAgent
The User-Agent header the generated client sends.
client.offsetSemantics
How an offset-paginated endpoint advances: by the number of items returned, or by one page.
package
Package metadata inherited by every target. Package identity fields such as packageName usually belong on each target.
package.packageName
The package name used by the target language registry.
package.moduleName
The generated module or import name when it differs from the package name.
package.modulePath
The Go module path used for imports and publishing.
package.namespace
The namespace or package prefix for generated code.
package.groupId
The Maven group identifier.
package.artifactId
The Maven artifact identifier.
package.description
The package description used in generated metadata.
package.repository
The source repository for the generated SDK.
package.homepage
The package homepage URL.
package.documentationUrl
The package documentation URL.
package.authors
Authors credited in package metadata.
package.developers
Developers credited in package metadata.
package.license
License metadata for the generated package.
package.keywords
Search keywords for package metadata.
package.classifiers
Package classifiers used by registries such as PyPI.
package.projectUrls
Labeled project links for package metadata.
package.extraDependencies
Additional runtime dependencies added to the generated package.
package.extraDevDependencies
Additional development dependencies added to the generated package.
package.extraPeerDependencies
Additional peer dependencies added to the generated package.
package.extraPeerDependenciesMeta
npm peerDependenciesMeta entries keyed by peer dependency name, such as { optional: true }.
output
The default output delivery and publication configuration. A target’s output replaces this block for that target.
output.delivery
Where Fern delivers the generated SDK. files writes it to a directory, zip packages it as a ZIP archive, and github delivers it to a GitHub repository.
output.path
The destination directory for generated files. Applies to delivery: files.
output.fileName
The generated ZIP archive file name. Applies to delivery: zip.
output.github
GitHub repository delivery settings. Required for delivery: github.
github
output.github.repository
The GitHub repository that receives generated files.
output.github.host
The GitHub host for enterprise installations.
output.github.branch
The target branch for generated changes.
output.github.mode
How generated changes are delivered to the repository.
output.github.reviewers
Reviewers requested for generated pull requests.
output.github.credentials
Credentials used to authenticate GitHub delivery.
output.github.privateRepository
Whether the destination repository is private.
publish
Optional package registry publication. registry selects the registry, and the remaining fields depend on it.
output.publish.registry
The package registry to publish to.
output.publish.token
The registry token, or an environment expression that resolves to it. Applies to npm and crates.
output.publish.trustedPublishing
Whether npm publication uses trusted publishing (OIDC) instead of a token. Applies to npm.
output.publish.username
The registry username, or an environment expression that resolves to it. Applies to pypi and maven.
output.publish.password
The registry password or token, or an environment expression that resolves to it. Applies to pypi and maven.
output.publish.signature
Credentials used to sign Maven artifacts. Applies to maven.
output.publish.url
A custom package registry URL.
output.publish.releaseBranch
The branch used by generated package release workflows.
output.publish.tolerateRepublish
Whether an already-published package version is treated as non-fatal.
replay
replay.enabled
Whether regeneration reapplies customer-authored repository changes.
docs
docs.readme
README content and example configuration.
docs.snippets
Standalone usage snippet generation.
docs.referenceBaseUrl
The base URL used for links to generated API Reference files.
docs.includeApiReference
Whether API Reference documentation is included in the SDK output.
generation
Generation settings inherited by every target. Each target’s generation block also accepts language-specific settings, documented on each language’s configuration page.
generation.includeOptionalSnippetParameters
Whether usage snippets include optional request parameters.
generation.buildAllModels
Whether models not referenced by operations are also generated.
generation.inferServiceNames
Whether service names are inferred from API structure.
generation.includeDeprecatedOperations
Whether deprecated API operations are generated.
generation.multipleResponses
Whether operations model multiple successful response types.
generation.devContainer
Whether development-container configuration is generated.
generation.allowMockClient
Whether a mock API client is included in the generated SDK.
generation.ignoreFiles
Generated paths excluded from the final output.
generation.reservedKeywords
Additional identifiers treated as reserved words.
generation.customCode
Customer-authored code merge configuration.
generation.customCode.enabled
Whether customer-authored code is merged into generated output.
generation.customCode.source
The source containing customer-authored code.
<ParamField path=“generation.customCode.source.type” type=""path"" required= toc=> Loads the generation asset from a relative path. </ParamField>
generation.customCode.source.location
The relative path to the generation asset.
<ParamField path=“generation.customCode.conflictStrategy” type=""mark” | “ours” | “theirs"" required= toc=> How merge conflicts between generated and custom code are handled. </ParamField>
generation.customCode.trackChanges
Whether custom-code changes are tracked between builds.
generation.customCode.protectedFiles
Generated file paths that custom-code merging must not overwrite.
generation.customQueryPaths
Relative paths to custom query definitions.
generation.analytics
Generated client telemetry configuration.
generation.analytics.enabled
Whether generated clients export usage telemetry.
generation.analytics.endpoint
The telemetry export endpoint.
<ParamField path=“generation.analytics.exporter” type=""otlp-http” | “console"" required= toc=> The telemetry exporter implementation. </ParamField>
generation.analytics.headers
Headers sent by the telemetry exporter.
generation.analytics.batchSize
The maximum spans in each export batch.
generation.analytics.scheduledDelayMs
The delay between scheduled exports, in milliseconds.
generation.analytics.exportTimeoutMs
The maximum time allowed for an export, in milliseconds.
generation.wireTests
Wire-level request and response test generation.
generation.wireTests.enabled
Whether wire-level request and response tests are generated.
generation.wireTests.exclusions
Operations excluded from wire tests.
generation.wireTests.fallbackToGeneratedErrorExamples
Whether missing error fixtures are synthesized from generated examples.
<ParamField path=“generation.wireTests.fixtureSource” type=""synthetic” | “recorded” | “auto"" required= toc=> Where wire-test fixtures are obtained. </ParamField>
generation.unitTests
SDK unit-test generation.
generation.unitTests.enabled
Whether SDK unit tests are generated.
generation.unitTests.exclusions
Operations excluded from unit tests.
generation.webSockets
Whether WebSocket clients are generated for supported channels.
generation.streams
Streaming response generation behavior.
generation.streams.enabled
Whether generated clients expose streaming response APIs.
<ParamField path=“generation.streams.responseType” type=""wrapper” | “native” | “web"" required= toc=> The streaming response abstraction exposed by generated clients. </ParamField>
<ParamField path=“generation.streams.fileResponseType” type=""stream” | “binary-response"" required= toc=> The response type used for file downloads. </ParamField>
generation.streams.defaultChunkSizeBytes
The default number of bytes yielded by streaming iterators.
generation.naming
Names and casing used by generated code.
generation.naming.clientName
The generated client class name.
generation.naming.exportedClientName
The client name exported from the generated package.
generation.naming.environmentTypeName
The generated type name for API environments.
generation.naming.apiErrorName
The generated API error class name.
generation.naming.baseErrorName
The generated base error class name.
generation.naming.pagerName
The generated pagination helper name.
generation.naming.smartCasing
Whether generated identifiers use initialism-aware casing.
generation.naming.smartCasingDigitWordBoundary
Whether smart casing preserves a word boundary after digits.
generation.layout
Generated project and source layout.
<ParamField path=“generation.layout.outputDirectory” type=""project-root” | “source-root"" required= toc=> Whether generated source is rooted at the project or its source directory. </ParamField>
generation.layout.packagePath
The package-relative path for generated source files.
generation.serialization
Generated model serialization behavior.
<ParamField path=“generation.serialization.enumRepresentation” type=""enum” | “union” | “literal” | “forward-compatible-enum” | “language-default"" required= toc=> How schema enums are represented in generated code. </ParamField>
<ParamField path=“generation.serialization.additionalProperties” type=""allow” | “forbid” | “ignore” | “language-default"" required= toc=> How undeclared object properties are handled. </ParamField>
generation.serialization.inlineTypes
Whether inline schemas remain nested under their parent types.
generation.serialization.omitUndefined
Whether undefined properties are omitted during serialization.
targets
Language targets to generate. Each language may appear once per file. Generate a single target with fern generate --target <language>.
targets[].language
The language to generate. The value determines which language-specific settings generation accepts.
targets[].generation
Common and TypeScript-specific generation settings for this target.
targets[].generatorVersion
The exact generator version used for this target.
targets[].sdkName
An SDK name that overrides the root value for this target.
targets[].sdkVersion
An SDK version that overrides the root value for this target.
targets[].client
Client settings that override root client configuration for this target.
targets[].docs
Documentation settings that override root documentation for this target.
targets[].package
Package metadata that overrides root package configuration for this target.
targets[].output
Output configuration that replaces the root output for this target.