Skip to content

ideal-auth

Session auth, password hashing, 2FA, token verification, and rate limiting. Bring your own schema. Works with any framework.

Why ideal-auth?

Framework agnostic

Works with Next.js, SvelteKit, Nuxt, TanStack Start, Express, Hono, and any framework that can get, set, and delete cookies.

Bring your own schema

No database adapters or ORM lock-in. You provide resolveUser and resolveUserByCredentials — use any database, any schema.

Encrypted sessions

Session payloads are encrypted with AES-256-CBC and authenticated with HMAC via iron-session. No plaintext tokens, no JWTs.

TOTP 2FA with recovery codes

RFC 6238 compliant one-time passwords with configurable digits, period, and window. Generate hashed recovery codes out of the box.

Security-first defaults

httpOnly cookies are always forced on. bcrypt uses SHA-256 prehash for long passwords. All comparisons are timing-safe. secure defaults to true in production.

Runs everywhere

Zero framework dependencies. Works in Node.js, Bun, and Deno with no configuration changes.

What's included

Type to search…

↑↓ navigate↵ selectEsc close