Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 763 Bytes

File metadata and controls

24 lines (16 loc) · 763 Bytes

Drizzle Database Adapter Example

Next.js example using the Integrate Drizzle adapter to persist OAuth tokens in SQLite.

Setup

bun install
cp .env.example .env
# Add INTEGRATE_API_KEY, GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET

bun run db:push
bun dev

Open http://localhost:3000, connect GitHub, and list repos. Tokens are stored in local.db via Drizzle.

Key files

  • src/lib/schema.ts — provider_token and trigger tables
  • src/lib/db.ts — Drizzle client (SQLite)
  • src/lib/integrate.ts — drizzleAdapter + getSessionContext

This example uses a fixed DEMO_USER_ID for session context. Wire getSessionContext to your auth library in production.