Get inspired by API documentation built with Fern: Webflow | You.com | Cohere | ElevenLabs
- Node.js 22+ (required for
npm install) orHomebrew (macOS/Linux) - A GitHub account
- A Fern account (free to start)
Install the Fern CLI globally using one of the following methods:
npm (all platforms):
npm install -g fern-apiHomebrew (macOS / Linux):
brew install fern-apiVerify the installation:
fern --versionfern/
├── docs.yml # Site config: navigation, theme, tabs, navbar links
├── fern.config.json # Organization name and CLI version
├── generators.yml # API spec sources (OpenAPI, AsyncAPI)
├── openapi.yaml # Sample Plant Store OpenAPI spec
├── asyncapi.yaml # Sample AsyncAPI spec
├── styles.css # Custom CSS overrides
├── snippets/ # Reusable MDX content fragments
├── docs/
│ ├── pages/ # Markdown (MDX) documentation pages
│ ├── assets/ # Logos, favicon, and static assets
│ └── changelog/ # Changelog entries
└── ...
.github/
└── workflows/
├── check.yml # Validates your API spec on every PR and push
├── preview-docs.yml # Generates a preview URL on every PR
└── publish-docs.yml # Publishes docs to production on merge to main
This repository is the official starter template for Fern Docs — the same one used in the Fern Docs quickstart. The steps below get you publishing; the quickstart walks through the same flow with more narration and screenshots.
Prefer a no-code setup? Use the guided UI to get started from your browser instead.
Create your repository. Click "Use this template" on GitHub and clone the result, or use the GitHub CLI. To start from an empty project instead, run
fern init --docs.gh repo create my-org/my-docs --template fern-api/docs-starter --clone
Configure your organization. Set your organization name in
fern/fern.config.jsonand your docs URL infern/docs.yml:# fern/fern.config.json { "organization": "your-org-name", "version": "5.35.4" }
# fern/docs.ymlinstances: - url: your-org-name.docs.buildwithfern.com
Validate your configuration.
fern check
Preview locally with hot-reloading at localhost:3000.
fern docs dev
Publish to go live, or add
--previewfor a shareable preview URL. Runfern loginonce first to authenticate; the credential is cached for future runs.fern login fern generate --docs
This template includes three GitHub Actions workflows out of the box:
| Workflow | Trigger | What it does |
|---|---|---|
check.yml | Every PR and push to main | Runs fern check to validate your API spec |
preview-docs.yml | Every PR | Generates a preview URL and posts it as a PR comment |
publish-docs.yml | Push to main (after first build) | Publishes your docs to production |
CI/CD runs non-interactively, so it needs a Fern API key (FERN_TOKEN) instead of fern login. Generate a non-expiring key with fern token (or from the Fern dashboard under API keys), then add it as a repository secret:
- Go to Settings > Secrets and variables > Actions in your GitHub repository.
- Click New repository secret.
- Name it
FERN_TOKENand paste your value.
The check.yml workflow works without an API key; only preview and publish require it.
Once you're up and running, tailor your docs to match your brand and product:
- Brand your docs — Set custom colors, logo, favicon, and fonts in
docs.yml - Add an API reference — Auto-generate interactive API docs from your OpenAPI spec
- Use components — Tabs, accordions, callouts, cards, and more out of the box
- Set up a custom domain — Host on your own domain (e.g.,
docs.example.com) - Configure analytics — Integrate with PostHog, Segment, Google Tag Manager, and others
- Customize navigation — Add versioned docs, tabs, nested sections, and multi-product layouts
Need help? Set up a call with an expert or email us at support@buildwithfern.com.