⚡ BolkAuth

BolkAuth is a self-hosted authentication toolkit for TypeScript applications. It provides a core auth engine, React hooks, Next.js App Router helpers, middleware, CLI scaffolding, and database adapters while keeping your user data in your own database.

Start Here

Use these pages in order when adding BolkAuth to a new app:

  1. Installation - install the packages for your framework and adapter.
  2. Quick Start - wire createBolkAuth, the route handler, provider, and middleware.
  3. Configuration - set secrets, sessions, email, OAuth, OTP, and onboarding options.
  4. Core Concepts - understand the engine, adapter boundary, session model, and request flow.

Main Sections

SectionUse it for
AuthenticationEmail/password, OAuth, OTP, magic links, and sessions
ReactProvider setup and headless hooks
Next.jsApp Router route handlers and server helpers
MiddlewareProtecting routes and configuring public paths
Server ActionsReading the user and mutating profile data server-side
AdaptersDrizzle, Prisma, MongoDB notes, and custom adapter implementations
CLIProject scaffolding and generated files
SecurityCookie, JWT, OAuth, rate limiting, and production hardening
DeploymentEnvironment variables, OAuth callback URLs, and database pooling
API ReferenceEndpoints, config shape, hooks, helpers, and adapter methods
TroubleshootingCommon setup, runtime, OAuth, database, and type errors

Package Map

PackagePurpose
@bolkauth/coreRuntime-independent auth engine, sessions, password hashing, OTP, OAuth, and adapter types
@bolkauth/reactBolkAuthProvider and headless hooks for client UI
@bolkauth/nextjsApp Router route handler, middleware, and server helpers
@bolkauth/adapter-drizzleDrizzle ORM adapter with dialect-specific exports
@bolkauth/adapter-prismaPrisma adapter and schema examples
@bolkauth/adapter-mongodbMongoDB adapter for document storage
@bolkauth/cliScaffolding commands for auth setup and adapter files

On this page