Development Setup
This guide explains how to set up the AuthHero development environment.
Prerequisites
- Node.js (version 16 or higher)
- npm, yarn, or pnpm package manager
- Git
Getting the Code
- Clone the repository:
bash
git clone https://github.com/yourusername/authhero.git
cd authhero- Install dependencies:
bash
pnpm installProject Structure
AuthHero is organized as a monorepo with several packages and applications:
packages/: Contains the core library and adaptersapps/: Contains the admin UI, the docs site, the marketing website and the conformance runner
Running the Projects
You can run all projects in parallel with:
bash
pnpm devOr run a specific project:
bash
pnpm <project-name>For example:
bash
pnpm adminBuilding
Build all projects:
bash
pnpm buildOr build a specific project:
bash
pnpm <project-name> buildGenerated files
Some generated files are committed, so builds don't rewrite the source tree. Builds only check that they're current and fail if they're stale.
| File | Regenerate after changing | Command |
|---|---|---|
packages/adapter-interfaces/src/types/codeHookApiDeclarations.generated.json: the TypeScript declarations of each trigger's Action api, sent to AI generators | packages/adapter-interfaces/src/types/codeHookApiTypes.ts | pnpm --filter @authhero/adapter-interfaces generate:action-types |
The @authhero/adapter-interfaces build runs check:action-types, so CI fails on a stale file (the pre-commit hook doesn't build, so it won't catch it). If it fails with "Action API declarations are stale", run the command above and commit the result.
Next Steps
After setting up your development environment, you might want to:
- Read the code style guide
- Learn about testing
- Understand the release process