Configure global headers
If your API requires certain headers on every request (or most requests), you can configure them as global headers. Fern will generate an SDK that accepts these headers once in the client constructor and automatically includes them in all API calls.
Generated SDK behavior
Once you configure a global header, Fern generates an SDK that accepts the header value as a constructor parameter:
SDK users provide the value once, and the generated SDK automatically includes the header in all requests.
Setting up global headers
Fern automatically identifies headers used in every request, or the majority of requests, and marks them as global. You can manually configure additional global headers in your API definition:
OpenAPI
Fern Definition
openapi.yml
For full configuration details, see the docs for your API definition format: