diff --git a/fern/products/cli-api-reference/pages/commands.mdx b/fern/products/cli-api-reference/pages/commands.mdx index cb5aad6cc7..60ef86547f 100644 --- a/fern/products/cli-api-reference/pages/commands.mdx +++ b/fern/products/cli-api-reference/pages/commands.mdx @@ -674,7 +674,7 @@ hideOnThisPage: true - See [Publishing your docs](/learn/docs/preview-publish/publishing-your-docs#usage-in-github-actions) for instructions on using this token in automated publishing workflows. + See [Publishing your docs](/learn/docs/preview-publish/publishing-your-docs#usage-in-github-actions) for instructions on using this API key in automated publishing workflows. diff --git a/fern/products/dashboard/assets/api-keys.mp4 b/fern/products/dashboard/assets/api-keys.mp4 new file mode 100644 index 0000000000..3e1b245c2f Binary files /dev/null and b/fern/products/dashboard/assets/api-keys.mp4 differ diff --git a/fern/products/dashboard/dashboard.yml b/fern/products/dashboard/dashboard.yml index 80888ee777..221c7846d8 100644 --- a/fern/products/dashboard/dashboard.yml +++ b/fern/products/dashboard/dashboard.yml @@ -8,6 +8,8 @@ navigation: - page: Member permissions path: ./pages/permissions.mdx slug: permissions + - page: API keys + path: ./pages/api-keys.mdx - page: Connect a GitHub repository path: ./pages/github-repo.mdx slug: github-repo diff --git a/fern/products/dashboard/pages/api-keys.mdx b/fern/products/dashboard/pages/api-keys.mdx new file mode 100644 index 0000000000..774d7a6d4f --- /dev/null +++ b/fern/products/dashboard/pages/api-keys.mdx @@ -0,0 +1,62 @@ +--- +title: API keys +description: Create and manage API keys for CLI authentication in CI/CD environments. +--- + +[Admins](/learn/dashboard/configuration/permissions) can create and manage API keys from the [Fern Dashboard](https://dashboard.buildwithfern.com/fern/tokens). API keys authenticate the Fern CLI in CI/CD pipelines, for example when publishing SDKs or documentation from GitHub Actions. + + + API keys don't expire. Rotate them periodically and delete any that are no longer in use. + + + + + + +## Create an API key + + + + +Navigate to the [Fern Dashboard](https://dashboard.buildwithfern.com/) and select **API Keys** from the sidebar. + + + + +Select **Create key**, enter a name (e.g. `CI/CD pipeline`), then select **Generate**. + +The API key is displayed once. Copy it immediately; you won't be able to view it again. + + + + + +Add the API key as a repository secret named `FERN_TOKEN` in your CI/CD provider (e.g. GitHub Actions, GitLab CI). The Fern CLI reads this value from the environment to authenticate, so any workflow that runs a `fern` command can reference it: + +```yaml title="GitHub Actions example" +env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} +``` + +The rest of the workflow depends on what you publish: the same token authenticates [publishing your docs](/learn/docs/preview-publish/publishing-your-docs) and [publishing an SDK to a package registry](/learn/sdks/generators/typescript/publishing). + + + + +## Manage API keys + +From the **API Tokens** page, you can: + +- **Rename an API key** — select the options menu next to an API key and choose **Edit name**. +- **Delete an API key** — select the options menu and choose **Delete**. Deleted API keys are immediately revoked and can't be restored. + + + All [members](/learn/dashboard/configuration/permissions) can view API key names and creation dates. Only Admins can create, rename, or delete API keys. + diff --git a/fern/products/dashboard/pages/changelog/2026-06-02.mdx b/fern/products/dashboard/pages/changelog/2026-06-02.mdx new file mode 100644 index 0000000000..52f0c7a02b --- /dev/null +++ b/fern/products/dashboard/pages/changelog/2026-06-02.mdx @@ -0,0 +1,19 @@ +--- +tags: ["security"] +--- + +## API key management + +You can now create, rename, and delete API keys [directly from the Dashboard](https://dashboard.buildwithfern.com/fern/tokens). Name your API keys to keep track of where each one is used, and rotate old keys when needed. + + + + + + diff --git a/fern/products/dashboard/pages/overview.mdx b/fern/products/dashboard/pages/overview.mdx index 8b4ce7108d..6a3699d48c 100644 --- a/fern/products/dashboard/pages/overview.mdx +++ b/fern/products/dashboard/pages/overview.mdx @@ -40,6 +40,13 @@ Visit your team's [Dashboard](https://dashboard.buildwithfern.com/) and complete > Set up AI-powered chat for your documentation. + + Create and manage API keys for CLI authentication in CI/CD. + `](/learn/docs/writing- ## Accessing protected docs -On sites with [authentication](/learn/docs/authentication/overview) enabled, agents must include a JWT on every Markdown request — whether for an individual page, `llms.txt`, or `llms-full.txt`. Exchange your [Fern token](/learn/cli-api/cli-reference/commands#fern-token) for a [JWT](/learn/docs/fern-api-reference/get-jwt): +On sites with [authentication](/learn/docs/authentication/overview) enabled, agents must include a JWT on every Markdown request — whether for an individual page, `llms.txt`, or `llms-full.txt`. Exchange your [Fern API key](/learn/cli-api/cli-reference/commands#fern-token) for a [JWT](/learn/docs/fern-api-reference/get-jwt): ```bash Get a JWT curl https://docs.example.com/api/fern-docs/get-jwt \ diff --git a/fern/products/docs/pages/ai/writer.mdx b/fern/products/docs/pages/ai/writer.mdx index 79c4ce4238..21cd5689f8 100644 --- a/fern/products/docs/pages/ai/writer.mdx +++ b/fern/products/docs/pages/ai/writer.mdx @@ -76,7 +76,7 @@ To start using Fern Writer, add it to your Slack workspace (you must be a Slack [Get a unique Slack installation link](/learn/docs/scribe-api/fern-writer-api/get-fern-writer-install-link) for your organization. Provide: -- Your [Fern token](/learn/cli-api-reference/cli-reference/commands#fern-token) +- Your [Fern API key](/learn/cli-api-reference/cli-reference/commands#fern-token) - The GitHub repository containing your documentation in `owner/repo` format (e.g., `acme/docs`). The [Fern GitHub App](https://github.com/apps/fern-api) must be installed in the repository. You can alternatively use this cURL request: diff --git a/fern/products/docs/pages/ask-fern/api-get-started.mdx b/fern/products/docs/pages/ask-fern/api-get-started.mdx index 1f6327dc5a..ad8bbaf430 100644 --- a/fern/products/docs/pages/ask-fern/api-get-started.mdx +++ b/fern/products/docs/pages/ask-fern/api-get-started.mdx @@ -14,4 +14,4 @@ The Fern AI API allows you to manage your Ask Fern configuration using Fern's pu ## Authentication -Fern API requests require a bearer token for authentication. Use the CLI command [`fern token`](/learn/cli-api/cli-reference/commands#fern-token) to generate a bearer token. Tokens don't expire. +Fern API requests require an API key for authentication. Use the CLI command [`fern token`](/learn/cli-api/cli-reference/commands#fern-token) to generate an API key. API keys don't expire. diff --git a/fern/products/docs/pages/ask-fern/slack-app.mdx b/fern/products/docs/pages/ask-fern/slack-app.mdx index d68f654969..506d77236b 100644 --- a/fern/products/docs/pages/ask-fern/slack-app.mdx +++ b/fern/products/docs/pages/ask-fern/slack-app.mdx @@ -20,7 +20,7 @@ Install the Ask Fern app in your workspace and add the bot to customer channels. Use the [API Explorer](/learn/docs/ai-features/ask-fern/api-reference/slack-ask-fern/get-slack-install-link) to get a unique Slack installation link for your organization. Provide: -- Your Fern token +- Your Fern API key - Your domain without protocol or path (e.g., `website.com`, not `https://website.com/docs`) You can alternatively use this cURL request: diff --git a/fern/products/docs/pages/developer-tools/gitlab.mdx b/fern/products/docs/pages/developer-tools/gitlab.mdx index 4772a57d4f..4552f16052 100644 --- a/fern/products/docs/pages/developer-tools/gitlab.mdx +++ b/fern/products/docs/pages/developer-tools/gitlab.mdx @@ -12,25 +12,25 @@ Use GitLab CI/CD to automatically generate preview links on merge requests, publ - A Fern project with a `fern` folder ([quickstart](/learn/docs/getting-started/quickstart)) -## Add a Fern token to GitLab +## Add a Fern API key to GitLab -### Generate a Fern token +### Generate a Fern API key -Run [`fern token`](/learn/cli-api-reference/cli-reference/commands#fern-token) in your terminal from the directory containing your `fern` folder. This generates an organization-scoped token that authenticates the Fern CLI in CI/CD. +Run [`fern token`](/learn/cli-api-reference/cli-reference/commands#fern-token) in your terminal from the directory containing your `fern` folder. This generates an organization-scoped API key that authenticates the Fern CLI in CI/CD. ```bash fern token ``` -Copy the token output — you'll add it to GitLab in the next step. +Copy the API key output — you'll add it to GitLab in the next step. -### Add the Fern token as a CI/CD variable +### Add the Fern API key as a CI/CD variable 1. Log in to [GitLab](https://gitlab.com/users/sign_in) and navigate to your Fern docs repository. 2. Go to **Settings** > **CI/CD**. 3. Scroll to the **Variables** section, select **Expand**, then click **Add variable**. -4. Set the key to `FERN_TOKEN`, paste the token you generated in the previous step as the value, _deselect_ **Protect variable**, and click **Save changes**. +4. Set the key to `FERN_TOKEN`, paste the API key you generated in the previous step as the value, _deselect_ **Protect variable**, and click **Save changes**. diff --git a/fern/products/docs/pages/getting-started/quickstart.mdx b/fern/products/docs/pages/getting-started/quickstart.mdx index d41036be88..ebce41e0f3 100644 --- a/fern/products/docs/pages/getting-started/quickstart.mdx +++ b/fern/products/docs/pages/getting-started/quickstart.mdx @@ -274,7 +274,7 @@ This guide covers the CLI path. A browser-based guided setup also exists at http - The Dashboard actions mentioned above are browser-only — there are no CLI equivalents for managing repository connections, organization members, or analytics. Use the Dashboard at https://dashboard.buildwithfern.com for these tasks. The CLI handles building, previewing, publishing, validation (`fern check`), and token generation (`fern token`). + The Dashboard actions mentioned above are browser-only — there are no CLI equivalents for managing repository connections, organization members, or analytics. Use the Dashboard at https://dashboard.buildwithfern.com for these tasks. The CLI handles building, previewing, publishing, validation (`fern check`), and API key generation (`fern token`). diff --git a/fern/products/docs/pages/getting-started/self-service-setup.mdx b/fern/products/docs/pages/getting-started/self-service-setup.mdx index 92f74488ed..7deec1a23c 100644 --- a/fern/products/docs/pages/getting-started/self-service-setup.mdx +++ b/fern/products/docs/pages/getting-started/self-service-setup.mdx @@ -17,7 +17,7 @@ When you complete the self-service workflow, Fern publishes your documentation t The setup process also creates and configures: - **Organization**: An organization using your org ID, with you as a member. -- **Fern token**: A `FERN_TOKEN` in your repository's GitHub secrets that authenticates the [Fern CLI](/learn/cli-api-reference/cli-reference/overview) in your CI/CD workflows, scoped to your organization. +- **Fern API key**: A `FERN_TOKEN` in your repository's GitHub secrets that authenticates the [Fern CLI](/learn/cli-api-reference/cli-reference/overview) in your CI/CD workflows, scoped to your organization. - **GitHub Action**: A workflow that runs [`fern generate --docs`](/learn/cli-api-reference/cli-reference/commands#fern-generate---docs) whenever you push changes to your main branch, automatically rebuilding and publishing your documentation. After setup, you have full ownership of this repository. Push changes to your main branch to trigger an automatic rebuild and publish of your docs, or manage settings through the [Fern Dashboard](https://dashboard.buildwithfern.com). @@ -89,7 +89,7 @@ Your documentation rebuilds automatically whenever you push changes to your main ### Troubleshooting - + If your documentation build fails with an authentication error, the `FERN_TOKEN` may not be set correctly. To resolve this: @@ -104,9 +104,9 @@ If your documentation build fails with an authentication error, the `FERN_TOKEN` ```bash fern token ``` - This generates a token scoped to your organization (as defined in `fern.config.json`). + This generates an API key scoped to your organization (as defined in `fern.config.json`). -4. Copy the token and add it as a [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) named `FERN_TOKEN`. +4. Copy the API key and add it as a [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) named `FERN_TOKEN`. 5. Go to the **Actions** tab in your repository and re-run the failed workflow. diff --git a/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx b/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx index cb6d582551..122dca0b00 100644 --- a/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx +++ b/fern/products/docs/pages/preview-publish/preview-changes-locally.mdx @@ -128,7 +128,7 @@ You can use a GitHub Actions workflow to automatically generate a preview URL wh If you set up your site using the [guided UI](https://dashboard.buildwithfern.com/get-started) or [CLI quickstart](/learn/docs/getting-started/quickstart), this workflow is automatically included in your repository. Otherwise, add it manually using the examples below. -These workflows require a `FERN_TOKEN` [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository). If you used the guided workflow, this secret is added automatically. Otherwise, run [`fern token`](/learn/cli-api-reference/cli-reference/commands#fern-token) in your terminal to generate a token, then add it in your repository's **Settings > Secrets and variables > Actions** with the name `FERN_TOKEN`. +These workflows require a `FERN_TOKEN` [repository secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository). If you used the guided workflow, this secret is added automatically. Otherwise, generate an API key from the [API keys](/learn/dashboard/configuration/api-keys) page in the Dashboard or by running [`fern token`](/learn/cli-api-reference/cli-reference/commands#fern-token) in your terminal, then add it in your repository's **Settings > Secrets and variables > Actions** with the name `FERN_TOKEN`. You may need to re-run preview builds for any PRs that were opened before you configured the `FERN_TOKEN`. diff --git a/fern/products/docs/pages/preview-publish/publishing-your-docs.mdx b/fern/products/docs/pages/preview-publish/publishing-your-docs.mdx index 31ace6044e..4e0b862ee5 100644 --- a/fern/products/docs/pages/preview-publish/publishing-your-docs.mdx +++ b/fern/products/docs/pages/preview-publish/publishing-your-docs.mdx @@ -197,7 +197,7 @@ To unpublish a docs site, navigate to the **Settings** page for your site in the ### No token found. Please set the FERN_TOKEN environment variable or run `fern login`. -`fern generate --docs` needs an authenticated session to publish. Run [`fern login`](/learn/cli-api-reference/cli-reference/commands#fern-login) locally, or set `FERN_TOKEN` in your shell or CI environment. Use [`fern token`](/learn/cli-api-reference/cli-reference/commands#fern-token) to generate a CI-friendly token. +`fern generate --docs` needs an authenticated session to publish. Run [`fern login`](/learn/cli-api-reference/cli-reference/commands#fern-login) locally, or set `FERN_TOKEN` in your shell or CI environment. Generate an API key from the [API keys](/learn/dashboard/configuration/api-keys) page in the Dashboard or by running [`fern token`](/learn/cli-api-reference/cli-reference/commands#fern-token). ### OpenAPI spec validation failed with N errors. Fix the errors above before generating docs. diff --git a/fern/products/sdks/deep-dives/self-hosted.mdx b/fern/products/sdks/deep-dives/self-hosted.mdx index 4567ee772e..03f369b603 100644 --- a/fern/products/sdks/deep-dives/self-hosted.mdx +++ b/fern/products/sdks/deep-dives/self-hosted.mdx @@ -41,15 +41,15 @@ docker ps - + -Generate a Fern token, which is required for local generation to verify your organization. +Generate a Fern API key, which is required for local generation to verify your organization. Create one from the [API keys](/learn/dashboard/configuration/api-keys) page in the Dashboard, or run `fern token` in your terminal: ```bash fern token ``` -The token is specific to your organization defined in `fern.config.json` and doesn't expire. +The API key is specific to your organization defined in `fern.config.json` and doesn't expire. @@ -102,7 +102,7 @@ Configure authentication based on your chosen output location. -Set your Fern token as an environment variable: +Set your Fern API key as an environment variable: ```bash export FERN_TOKEN=your-generated-token @@ -113,7 +113,7 @@ export FERN_TOKEN=your-generated-token Set up GitHub secrets for authentication. In your repository's **Settings** > **Secrets and variables** > **Actions**, add: -- `FERN_TOKEN`: The token you generated above +- `FERN_TOKEN`: The API key you generated above - `GITHUB_TOKEN`: A [GitHub personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with repository write access diff --git a/fern/products/sdks/generators/csharp/publishing-to-nuget.mdx b/fern/products/sdks/generators/csharp/publishing-to-nuget.mdx index c5f63b932d..3a5baaf85a 100644 --- a/fern/products/sdks/generators/csharp/publishing-to-nuget.mdx +++ b/fern/products/sdks/generators/csharp/publishing-to-nuget.mdx @@ -204,12 +204,12 @@ You can also use the url `https://github.com//settings/secrets/action - + 1. Select **New repository secret**. 1. Name your secret `FERN_TOKEN`. -1. Add your Fern token. If you don't already have one, generate one by - running `fern token`. By default, the `fern_token` is generated for the +1. Add your Fern API key. If you don't already have one, generate one by + running `fern token`. By default, the API key is generated for the organization listed in `fern.config.json`. 1. Click **Add secret**. diff --git a/fern/products/sdks/generators/java/publishing-to-maven-central.mdx b/fern/products/sdks/generators/java/publishing-to-maven-central.mdx index 9f65a19b2a..7d5d5a7176 100644 --- a/fern/products/sdks/generators/java/publishing-to-maven-central.mdx +++ b/fern/products/sdks/generators/java/publishing-to-maven-central.mdx @@ -241,12 +241,12 @@ Set up a release workflow via [GitHub Actions](https://docs.github.com/en/action You can also use the url `https://github.com//settings/secrets/actions`. - + 1. Select **New repository secret**. 1. Name your secret `FERN_TOKEN`. - 1. Add your Fern token. If you don't already have one, generate one by - running `fern token`. By default, the `fern_token` is generated for the + 1. Add your Fern API key. If you don't already have one, generate one by + running `fern token`. By default, the API key is generated for the organization listed in `fern.config.json`. 1. Click **Add secret**. diff --git a/fern/products/sdks/generators/python/publishing-to-pypi.mdx b/fern/products/sdks/generators/python/publishing-to-pypi.mdx index 23830b6011..1b239a8179 100644 --- a/fern/products/sdks/generators/python/publishing-to-pypi.mdx +++ b/fern/products/sdks/generators/python/publishing-to-pypi.mdx @@ -243,12 +243,12 @@ You can also use the url `https://github.com//settings/secrets/action - + 1. Select **New repository secret**. 1. Name your secret `FERN_TOKEN`. -1. Add your Fern token. If you don't already have one, generate one by - running `fern token`. By default, the `fern_token` is generated for the +1. Add your Fern API key. If you don't already have one, generate one by + running `fern token`. By default, the API key is generated for the organization listed in `fern.config.json`. 1. Click **Add secret**. diff --git a/fern/products/sdks/generators/rust/publishing-to-crates-io.mdx b/fern/products/sdks/generators/rust/publishing-to-crates-io.mdx index 8e12a09a63..0125f6d1f1 100644 --- a/fern/products/sdks/generators/rust/publishing-to-crates-io.mdx +++ b/fern/products/sdks/generators/rust/publishing-to-crates-io.mdx @@ -181,12 +181,12 @@ You can also use the url `https://github.com//settings/secrets/action 1. Click **Add secret**. - + 1. Select **New repository secret**. 1. Name your secret `FERN_TOKEN`. -1. Add your Fern token. If you don't already have one, generate one by - running `fern token`. By default, the `fern_token` is generated for the +1. Add your Fern API key. If you don't already have one, generate one by + running `fern token`. By default, the API key is generated for the organization listed in `fern.config.json`. 1. Click **Add secret**. diff --git a/fern/snippets/fern-token.mdx b/fern/snippets/fern-token.mdx index 7908fb1379..8d9a72f5f4 100644 --- a/fern/snippets/fern-token.mdx +++ b/fern/snippets/fern-token.mdx @@ -1,4 +1,4 @@ -Use `fern token` to generate a token for authenticating the Fern CLI in CI/CD environments. The token is specific to your organization defined in [`fern.config.json`](/learn/sdks/overview/project-structure#fernconfigjson) and doesn't expire. +Use `fern token` to generate an API key for authenticating the Fern CLI in CI/CD environments. The API key is specific to your organization defined in [`fern.config.json`](/learn/sdks/overview/project-structure#fernconfigjson) and doesn't expire. You can also create and manage API keys from the [API keys](/learn/dashboard/configuration/api-keys) page in the Dashboard. ```bash