API keys

以 Markdown 格式查看

Admins can create and manage API keys from the Fern Dashboard. 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

1

Open the API keys page

Navigate to the Fern Dashboard and select API Keys from the sidebar.

2

Create a new API key

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.

3

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). The Fern CLI reads this value from the environment to authenticate, so any workflow that runs a fern command can reference it:

GitHub Actions example
1env:
2 FERN_TOKEN: ${{ secrets.FERN_TOKEN }}

The rest of the workflow depends on what you publish: the same token authenticates publishing your docs and publishing an SDK to a package registry.

Manage API keys

From the API Tokens page, you can:

  • Delete an API key — select the options menu next to an API key and choose Delete. Deleted API keys are immediately revoked and can’t be restored.

All members can view API key names and creation dates. Only Admins can create or delete API keys.