Fern's Local Docs Preview Now Enforces Role-Based Access Rules
Fern's Oct. 20 changelog says fern docs dev now applies role-based access control like a preview link, with a role selector and local password protection.

Fern’s fern docs dev command now enforces role-based access control on a local preview, according to the Fern docs changelog entry dated Oct. 20. Fern said the local server applies the rules “the same way a preview link does.”
A role selector shows what each viewer can see
The preview includes a role selector. Pick a role to see the site as a viewer with that role would, including which pages and navigation items that role can reach. A local preview did not apply these controls until now. Access rules could only be checked on a preview link or a deployed site.
Password protection also works locally
Fern said password protection now runs in local preview too. Set two environment variables before starting the server: FERN_AUTH_TYPE=password and FERN_AUTH_SECRET.
Key takeaways
fern docs devapplies role-based access control the way a preview link does.- A role selector lets a writer view the site as a specific role.
- Local password protection needs
FERN_AUTH_TYPE=passwordandFERN_AUTH_SECRET.
The take
We think the useful part is the shorter loop. An access rule is a promise about what a reader will not see. You can only keep it if you can test it where you write. Hidden pages tend to leak through navigation, search and links from other pages. Those leaks show up when you click around as the restricted role. Open the local preview, switch to the lowest role and try to reach every page you meant to hide.


