This guide walks you through installing Himayah, connecting it to your database, and mounting it in your framework of choice.
[!TIP]
Supercharge Your Setup: Skip the manual setup entirely! You can get a production-ready authentication configuration in seconds by running the interactive scaffolding CLI:
npx himayah init
This tool dynamically configures your choice of 8 frameworks, 3 ORMs, 3 databases, and handles schemas, route handlers, and configurations automatically.
Himayah requires TypeScript 5+ and a runtime that supports the Web Crypto API (Node.js 18+, Cloudflare Workers, Deno, Bun, Vercel Edge, etc.).
Himayah is schema-first: you define the tables. Here's a minimal working schema:
If using Drizzle ORM, you can bypass writing 100+ lines of table schema code. Simply use the programmatic schema builder inside your schema definition file:
// Sign up a new userconst result = await authClient.password.signUp({ email: "user@example.com", password: "hunter2", name: "Jane Doe",});// Sign in an existing userconst session = await authClient.password.signIn({ email: "user@example.com", password: "hunter2",});// Get the current sessionconst { data: session } = await authClient.getSession();// Sign outawait authClient.signOut();
# Required — generate with: openssl rand -base64 32AUTH_SECRET="your-super-secret-32-char-minimum-key"# Required — your app's canonical public URLNEXT_PUBLIC_APP_URL="https://yourapp.com"# Required if using OAuth providersGITHUB_CLIENT_ID="..."GITHUB_CLIENT_SECRET="..."GOOGLE_CLIENT_ID="..."GOOGLE_CLIENT_SECRET="..."# Required if using Redis rate limitingREDIS_URL="redis://localhost:6379"