⚡ BolkAuth

BolkAuth stores users, sessions, OAuth accounts, verification tokens, and metadata through a BolkAuthAdapter. Official adapters cover the common database stacks, and the custom adapter interface lets you integrate any storage layer.

Adapter Options

AdapterPackageBest for
Drizzle@bolkauth/adapter-drizzleType-safe SQL with PostgreSQL or MySQL.
Prisma@bolkauth/adapter-prismaPrisma projects using PostgreSQL, MySQL, SQLite, or CockroachDB schemas.
MongoDB@bolkauth/adapter-mongodbDocument storage with the official MongoDB driver.
CustomYour codeExisting user models, unsupported ORMs, REST backends, or specialized storage.

Auth Configuration

Every adapter is passed to createBolkAuth the same way:

export const auth = createBolkAuth({
  adapter: createYourAdapter(db),
  secret: process.env.BOLKAUTH_SECRET!,
});

Required Data Areas

Adapters must support these records:

RecordPurpose
UserEmail, profile fields, password hash, and email verification timestamp.
SessionServer-side session record backing the signed cookie.
AccountOAuth provider account linked to a user.
Verification tokenMagic-link and OTP verification tokens.
User metadataOnboarding and custom metadata values.

Database Notes

For serverless deployments, prefer pooled or HTTP-compatible drivers:

DatabaseCommon deployment note
PostgreSQLUse PgBouncer, Neon pooled connections, or Supabase pooling.
MySQLUse a managed pool or PlanetScale-compatible serverless driver.
SQLiteUse local SQLite for embedded apps or Turso/libSQL for hosted apps.
MongoDBReuse a singleton MongoClient in development and configure maxPoolSize in production.

On this page