Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fern/products/cli-api-reference/pages/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ hideOnThisPage: true

<Markdown src="/snippets/fern-token.mdx" />

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.

</Accordion>

Expand Down
2 changes: 2 additions & 0 deletions fern/products/dashboard/dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
49 changes: 49 additions & 0 deletions fern/products/dashboard/pages/api-keys.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
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/). API keys authenticate the Fern CLI in CI/CD pipelines, for example when publishing SDKs or documentation from GitHub Actions.

<Note>
API keys don't expire. Rotate them periodically and delete any that are no longer in use.
</Note>

## Create an API key

<Steps>
<Step title="Open the API keys page">

Navigate to the [Fern Dashboard](https://dashboard.buildwithfern.com/) and select **API Tokens** from the sidebar.
</Step>

<Step title="Create a new API key">

Select **Create token**, enter a name (e.g. `CI/CD pipeline`), then select **Generate token**.

The API key is displayed once. Copy it immediately — you won't be able to view it again.
</Step>

<Step title="Store the API key as a secret">

Add the API key as a repository secret named `FERN_TOKEN` in your CI/CD provider (e.g. GitHub Actions, GitLab CI). Reference it in your workflow:

```yaml title="GitHub Actions example"
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
```

</Step>
</Steps>

## 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.

<Note>
All [members](/learn/dashboard/configuration/permissions) can view API key names and creation dates. Only Admins can create, rename, or delete API keys.
</Note>
11 changes: 11 additions & 0 deletions fern/products/dashboard/pages/changelog/2026-06-02.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
tags: ["security"]
---

## API key management

You can now create, rename, and delete API keys directly from the Dashboard. Name your API keys to keep track of where each one is used, and rotate old keys when needed.

To get started, go to **API Tokens** in the [Dashboard](https://dashboard.buildwithfern.com/) sidebar.

<Button intent="none" outlined rightIcon="arrow-right" href="/learn/dashboard/configuration/api-keys">Read the docs</Button>
8 changes: 8 additions & 0 deletions fern/products/dashboard/pages/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ Visit your team's [Dashboard](https://dashboard.buildwithfern.com/) and complete
>
Set up AI-powered chat for your documentation.
</Card>
<Card
title="API keys"
icon="regular key"
href="/learn/dashboard/configuration/api-keys"
>
Create and manage API keys for CLI authentication in CI/CD.
</Card>
<Card
title="Multi-source settings"
icon="regular code-branch"
Expand Down Expand Up @@ -171,6 +178,7 @@ Visit your team's [Dashboard](https://dashboard.buildwithfern.com/) and complete

- [Set up custom domain](/learn/dashboard/configuration/custom-domains): Configure your custom domain with automatic DNS record provisioning.
- [Member permissions](/learn/dashboard/configuration/permissions): Assign Admin, Editor, or Viewer roles to manage Dashboard and CLI access.
- [API keys](/learn/dashboard/configuration/api-keys): Create and manage API keys for CLI authentication in CI/CD.
- [Integrate GitHub](/learn/dashboard/configuration/github-repo): Connect your GitHub repository to your project.
- [Enable Ask Fern](/learn/docs/ai-features/ask-fern/overview): Set up AI-powered chat for your documentation.
- [Multi-source settings](/learn/dashboard/configuration/custom-domains#multi-source-settings): Configure default path and search scope for domains shared across multiple repositories.
Expand Down
1 change: 1 addition & 0 deletions fern/products/dashboard/pages/permissions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Viewers have read-only access to the Dashboard (settings, analytics) and can dep
| Manage members | Yes | No | No |
| Add or update a custom domain | Yes | No | No |
| Manage password protection | Yes | No | No |
| Manage [API keys](/learn/dashboard/configuration/api-keys) | Yes | No | No |
| Delete production docs sites | Yes | No | No |
| View dashboard and analytics | Yes | Yes | Yes |
| Publish to production | Yes | Configure per Editor | No |
Expand Down
2 changes: 1 addition & 1 deletion fern/products/docs/pages/ai/markdown.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Interactive components such as [`<EndpointRequestSnippet>`](/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 \
Expand Down
2 changes: 1 addition & 1 deletion fern/products/docs/pages/ai/writer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ To start using Fern Writer, add it to your Slack workspace (you must be a Slack
<Step title="Get your unique install link">

[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:
Expand Down
2 changes: 1 addition & 1 deletion fern/products/docs/pages/ask-fern/api-get-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion fern/products/docs/pages/ask-fern/slack-app.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Install the Ask Fern app in your workspace and add the bot to customer channels.
<Step title="Get your unique install link">

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:
Expand Down
12 changes: 6 additions & 6 deletions fern/products/docs/pages/developer-tools/gitlab.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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))
</Info>

## Add a Fern token to GitLab
## Add a Fern API key to GitLab

<Steps>
### 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**.

</Steps>

Expand Down
2 changes: 1 addition & 1 deletion fern/products/docs/pages/getting-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ This guide covers the CLI path. A browser-based guided setup also exists at http
</Info>

<llms-only>
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`).
</llms-only>
</Step>
</Steps>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -89,7 +89,7 @@ Your documentation rebuilds automatically whenever you push changes to your main
### Troubleshooting

<AccordionGroup>
<Accordion title="Fern token issues">
<Accordion title="Fern API key issues">

If your documentation build fails with an authentication error, the `FERN_TOKEN` may not be set correctly. To resolve this:

Expand All @@ -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.
</Accordion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

<Note>
You may need to re-run preview builds for any PRs that were opened before you configured the `FERN_TOKEN`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
10 changes: 5 additions & 5 deletions fern/products/sdks/deep-dives/self-hosted.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ docker ps

</Step>

<Step title="Generate a Fern token">
<Step title="Generate a Fern API key">

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.

</Step>

Expand Down Expand Up @@ -102,7 +102,7 @@ Configure authentication based on your chosen output location.
<Tabs>
<Tab title="Local file system" language="local">

Set your Fern token as an environment variable:
Set your Fern API key as an environment variable:

```bash
export FERN_TOKEN=your-generated-token
Expand All @@ -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

</Tab>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,12 +204,12 @@ You can also use the url `https://github.com/<your-repo>/settings/secrets/action
</Frame>

</Step>
<Step title="Add secret for your Fern Token">
<Step title="Add secret for your Fern API key">

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**.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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/<your-repo>/settings/secrets/actions`.

</Step>
<Step title="Add secret for your Fern Token">
<Step title="Add secret for your Fern API key">

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**.

Expand Down
6 changes: 3 additions & 3 deletions fern/products/sdks/generators/python/publishing-to-pypi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,12 @@ You can also use the url `https://github.com/<your-repo>/settings/secrets/action
</Frame>

</Step>
<Step title="Add secret for your Fern Token">
<Step title="Add secret for your Fern API key">

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**.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ You can also use the url `https://github.com/<your-repo>/settings/secrets/action
1. Click **Add secret**.

</Step>
<Step title="Add secret for your Fern token">
<Step title="Add secret for your Fern API key">

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**.

Expand Down
2 changes: 1 addition & 1 deletion fern/snippets/fern-token.mdx
Original file line number Diff line number Diff line change
@@ -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.

<CodeBlock title="terminal">
```bash
Expand Down
Loading