Skip to main content
Thank you for your interest in contributing to Better Auth! This page covers everything you need to get started.

GitHub Issues

Browse open issues or report a bug.

Discord

Ask questions and discuss ideas with the community.

Development setup

Make sure you have Node.js LTS and pnpm installed before continuing.
1

Fork and clone the repository

Visit github.com/better-auth/better-auth and click Fork. Then clone your fork:
2

Install dependencies

3

Set up environment variables

4

Create a feature branch

5

Start the development server


Running tests

Better Auth uses Vitest. Test files live next to the source files they cover.
Do not run pnpm test at the repo root — it runs all tests across all packages and takes a long time. Target specific files or patterns instead.
Adapter tests (PostgreSQL, MySQL, etc.) require Docker:

Using the test instance helper

The helper also exposes runWithUser and signInWithTestUser for authenticated test scenarios:

Code style

Better Auth uses Biome for formatting and linting.
All CI checks must pass before a PR is merged. Run the checks locally before opening a PR:
Style rules:
  • Use tabs for indentation in TypeScript; 2 spaces in JSON.
  • Avoid any types and unsafe typecasts.
  • Prefer functions and plain objects over classes.
  • Do not use runtime-specific APIs like Buffer in library code. Use Uint8Array instead.

PR guidelines

  • Target the canary branch, not main.
  • Use Conventional Commits for commit messages:
  • Keep PRs focused on a single change.
  • Add tests for new features and bug fixes.
  • Update documentation when changing public APIs.
  • If a PR fixes a numbered GitHub issue, add a JSDoc @see comment to the relevant test:

Contribution areas


Need help?