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.
Automate with GitHub Actions
Generate preview links automatically for every pull request by adding a GitHub Actions workflow. Add your FERN_TOKEN to the repository secrets before using these workflows.
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: