Preview changes
Fern offers two ways to preview documentation changes:
- Local development: Fast iteration with hot reload, best for active development
- Preview links: Shareable URLs for reviews and collaboration
Local development
Run a local preview server to view documentation changes instantly with hot reload. Offline access is available after the first online run.
Your documentation will be available at http://localhost:3000 (default) or the port you specified. If you attempt to run Fern on a port that’s already in use, it will use the next available port.
Some features are disabled in local development:
- Search
- SEO (favicon, auto-generated meta tags, etc.)
- Authentication
Preview links
Generate shareable preview URLs to review and collaborate on documentation changes before publishing. Each preview link includes a unique UUID and isn’t indexed by search engines. Links don’t expire.
You can also list all preview deployments for your organization and delete a preview deployment when it’s no longer needed:
Automate with GitHub Actions
If you set up your site using the guided UI or CLI quickstart, preview workflow files are automatically included in your repository. Otherwise, add them manually using the examples below.
These workflows require a FERN_TOKEN repository secret. If you used the guided workflow, this secret is added automatically. Otherwise, run 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.
You may need to re-run preview builds for any PRs that were opened before you configured the FERN_TOKEN.
For repositories that accept pull requests from forks
If your repository accepts contributions from forks, use pull_request_target instead of pull_request to allow the workflow to access your FERN_TOKEN secret: