All-in-one Better Auth + Stripe + Drizzle toolkit for Next.js App Router apps.
- Node
24(.nvmrcincluded) - pnpm
10.31.0viapackageManager
pnpm add @wiseiodev/dubs-authTo use the CLI in a consuming app, run via pnpm exec:
pnpm exec dubs-auth --help# scaffold env template, config, and Next route handlers
pnpm exec dubs-auth init
# generate schema ownership files for your host app
pnpm exec dubs-auth generate schemaimport {
createAuthRouteHandlers,
createDubsAuth,
dubsAuthSchema,
} from '@wiseiodev/dubs-auth';
export const auth = createDubsAuth({
baseUrl: process.env.BETTER_AUTH_URL!,
secret: process.env.BETTER_AUTH_SECRET!,
database: db,
databaseSchema: dubsAuthSchema,
providers: {
emailPassword: { enabled: true },
},
stripe: {
secretKey: process.env.STRIPE_SECRET_KEY!,
webhookSecret: process.env.STRIPE_WEBHOOK_SECRET!,
plans: [
{
key: 'starter',
displayName: 'Starter',
prices: {
monthly: process.env.STRIPE_STARTER_MONTHLY_PRICE_ID!,
annual: process.env.STRIPE_STARTER_ANNUAL_PRICE_ID!,
},
},
],
},
});
export const { GET, POST } = createAuthRouteHandlers(auth);- Imports and API surface
- Environment variables
- CLI reference (
--help, commands, flags) - Integration recipes
A runnable Next.js App Router sample lives at:
This example currently installs the published npm package and commits its own PGlite + Drizzle migration files for immediate local verification.
dubs-auth generate schema in the published package now scaffolds the full
auth table set (account, verification, invitation included).
pnpm --dir examples/next-app-router install
pnpm --dir examples/next-app-router exec dubs-auth generate schema --cwd .
cp examples/next-app-router/.env.example examples/next-app-router/.env
pnpm --dir examples/next-app-router db:migrate
PORT=4000 pnpm --dir examples/next-app-router devThen verify:
- Sign up at
/sign-up - Sign in at
/sign-in - Confirm session state at
/dashboard - Open
/billing(without Stripe envs this should return a clear "not configured" response)
pnpm exec dubs-auth --help
pnpm exec dubs-auth help initpnpm lint
pnpm run format:check
pnpm typecheck
pnpm test
pnpm build
pnpm run qualityFor CLI development inside this repository:
# run source directly
node --import tsx src/cli/index.ts --help
# run built artifact
node dist/cli/index.js --helpThis repo uses Conventional Commits with a required scope.
- Pass:
feat(cli): add --help coverage - Fail:
feat: add --help coverage
Husky runs commitlint on commit-msg locally.
Run pnpm install once per clone to install hooks via prepare.