fern token

Use fern token to generate a FERN_TOKEN that is specific to your organization that is defined in fern.config.json. Use the token to authenticate with the API in CI. Tokens do not expire.


$fern token

GitHub Actions

If using GitHub Actions as your CI, add the FERN_TOKEN as a GitHub Action secret in the repo where your Fern configuration is stored. Here are instructions for how to create a secret for a repo.

You can then reference the secret in your CI. Example:

1- name: Generate and Publish Documentation with Fern
3 FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
4run: fern generate --docs

See the full example on GitHub.