AuthHero Documentation
This is the VitePress-powered documentation site for AuthHero.
Development
To start the development server:
npm run devTo build the static site:
npm run buildTo preview the built site:
npm run previewStructure
/index.md- Homepage/getting-started.md- Getting started guide/architecture.md- Architecture overview/concepts.md- Core concepts/session-management.md- Session and login session architecture/components/- Component library documentation (with integrated Storybook)/api/- API documentation/apps/- Application documentation/packages/- Package documentation/guides/- User guides/contributing/- Contributing guidelines/auth0-comparison/- Auth0 comparison docs
The AuthHero Book
/book/ is a short book that explains authentication and AuthHero from start to finish. It is promoted on the homepage and is also published as a PDF and an EPUB.
book/chapters.jsonis the one list of chapters, grouped into parts. The sidebar, the contents on/book/, the PDF and the EPUB all read it, so adding or reordering a chapter is a change there plus the chapter's markdown file.- Each chapter is an ordinary page:
book/NN-slug.md. Keep the "Chapter N · Part" line above the title in step withchapters.json. - The downloads are
public/authhero-book.pdfandpublic/authhero-book.epub. Like the Storybook build, they are committed, so deploying the docs needs no browser. - Give every diagram in a chapter an
accDescr:line. The EPUB shows diagrams as images, and that line becomes the image's alternative text.
After editing a chapter, rebuild both files and commit them:
pnpm --filter @authhero/docs book:buildThis builds the site and opens every chapter in headless Chromium. The PDF is the chapters printed as one document with a cover and contents (scripts/build-book.mjs); the EPUB is the same chapters repacked for e-readers (scripts/book-epub.mjs). If Chromium is missing, install it once with pnpm --filter @authhero/docs exec playwright-core install chromium.
Storybook Integration
The component library Storybook is integrated into the documentation site. The built Storybook files are committed to the repository in public/storybook/ for deployment simplicity.
Building Documentation Only
npm run buildThis builds just the VitePress site (does not rebuild Storybook).
Building Documentation + Storybook
npm run build:fullThis rebuilds Storybook from packages/authhero and then builds VitePress.
Developing with Storybook
To work on components with live reload:
# In packages/authhero directory
cd ../../packages/authhero
pnpm storybookWhen to Rebuild Storybook
Run npm run build:full when:
- Component stories are added or modified
- Component implementations change
- You want to update the Storybook in the docs
Important: After rebuilding Storybook, commit the changes in public/storybook/ so they're deployed to production.
Configuration
The VitePress configuration is in .vitepress/config.ts.