Document base-url-env / x-fern-base-url-env for SDK base URL from an environment variable - #7011
Merged
Merged
Conversation
…om environment variable Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
requested review from
devalog and
jkonrath-postman
as code owners
September 18, 2026 17:08
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
devin-ai-integration
Bot
requested a review
from nerminamiller-postman
as a code owner
September 18, 2026 17:08
Contributor
|
🌿 Preview your docs: https://fern-preview-devin-1789751303-base-url-env-docs.docs.buildwithfern.com/learn Here are the markdown pages you've updated: |
nerminamiller-postman
approved these changes
Sep 23, 2026
nerminamiller-postman
deleted the
devin/1789751303-base-url-env-docs
branch
September 23, 2026 19:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generated SDKs can now read their base URL from an environment variable, the same way API keys already default from env vars. The API definition names the variable (
base-url-envinapi.yml,x-fern-base-url-envin OpenAPI, orbase-url-envunderapi.environmentsingenerators.yml), and the generated client falls back to it when the caller passes neitherbaseUrlnorenvironment. This lets customers point one SDK build at staging, production, or a self-hosted deployment via configuration instead of hard-coding or passing a base URL in code. Only the TypeScript SDK generator implements the fallback today, and the docs say so explicitly.Implements docs for: feat(typescript): read SDK base URL from configured environment variable (fern-api/fern#17736) — fern-api/fern#17736
Implements docs for: feat(cli): add base-url-env for SDK base URL environment variable (fern-api/fern#17705) — fern-api/fern#17705
Pages changed
fern/products/api-def/ferndef/api-yml/environments.mdx— new "Base URL from an environment variable" section (canonical home):api.ymlexample, resolution order (baseUrl>environment> env var > default environment),fern checkvalid-base-url-envwarning, TypeScript-only note.fern/products/api-def/openapi/extensions/server-names.mdx— new## x-fern-base-url-envsection with anopenapi.ymlexample and the precedence rule (generators.ymlbase-url-envwins over the spec).fern/products/api-def/openapi/extensions/overview.md— table row forx-fern-base-url-envlinking to that section.fern/products/sdks/reference/generators-yml-reference.mdx—environmentsParamField documentsbase-url-env, its precedence overx-fern-base-url-env, and that overridingenvironmentsalone keeps the spec's value.fern/products/sdks/generators/typescript/configuration.mdx—guardProcessEnvAccessnow covers the base URL env read;requireBaseUrlgains a sentence on the client's base URL resolution order (including standalone sub-clients).Auto-generated changelogs (
typescript/changelog/2026-09-16.mdx,cli-changelog/2026-09-15.mdx) were not edited. No Docs-product changelog entry (SDK/API definition feature).Checks:
pre-commit run --files <changed>(Vale passes; remaining findings are pre-existing on untouched lines) andnpx fern-api@5.59.0 check --warnings(0 errors).Link to Devin session: https://app.devin.ai/sessions/dcb35859297d4ee3bddc62db8cf40148
Open in Devin Desktop: https://app.devin.ai/desktop/session/dcb35859297d4ee3bddc62db8cf40148?variant=devin