Fern Definition isn’t recommended for new customers and Fern isn’t accepting feature requests for this format. It remains supported for existing users.
You can specify the environments where your server is deployed.
You can specify multiple URLs per environment. This is helpful if you have a microservice architecture, and you want a single SDK to interact with multiple servers.
If you choose to use this feature, you must specify a url for each service you define:
You can also provide a default environment:
For APIs deployed across multiple regions or environments, you can define URL templates with variable placeholders that SDK users customize at runtime. To set this up:
urls — these appear in the generated environments enum.url-templates with {variable} placeholders (e.g., https://api.{region}.example.com/v1) for each service. Fern exposes these as configurable parameters in the SDK.default-urls as concrete fallbacks so SDK users get a working client out of the box without supplying variables.variables for each service, each with an id, a default value, and an optional values list to constrain allowed options.If you would like all of your endpoints to be prefixed with a path, use base-path.
In the example below, every endpoint is prefixed with a /v1:
If you have listed environments that you want to filter, you can leverage audiences.