0.9.0
BetaBeta. The API may change before 1.0.
- addedSAML adapter behind the existing AuthIdentity interface.
- securitySessions now rotate on privilege change.
Sessions, OAuth and SSO seams with the security decisions already made and written down.
Authentication is where most codebases accumulate their quietest bugs. This toolkit ships the parts that are easy to get subtly wrong: session rotation on privilege change, an AuthIdentity model that makes adding SSO a row rather than a migration, and tokens stored hashed so a database read yields nothing usable.
Active sessions list with device and location
Only the hash is stored, so a database read cannot yield a usable session.
A role change rotates the session, closing the window where an old token carries new rights.
SAML slots into the existing AuthIdentity model without a schema change.
A User has many AuthIdentity records — password, GitHub, Google, SAML — rather than a password column. Users acquire login methods over time and enterprises demand SSO; modelling it this way from the start means the enterprise conversation costs a row.
src/
session/ issue · verify · rotate · revoke
identity/ password · oauth · saml adapters
policy/ what a role may do, as pure functionsThe archive contains the full source. There is no installer and no post-install script.
unzip auth-toolkit.zip
cd auth-toolkitpnpm installCopy the example file and fill in the variables listed under Environment variables.
cp .env.example .envpnpm devRuns formatting, lint, type-check, tests and a production build.
pnpm check| Variable | Required | Description |
|---|---|---|
DATABASE_URL | Required | PostgreSQL connection string. Use a pooled endpoint in serverless environments.postgresql://user:pass@localhost:5432/app |
SESSION_SECRET | Required | At least 32 characters. Rotating it invalidates every session, which is the intended emergency control. |
Absolute and idle expiry are separate values, because they answer different questions.
src/session/config.tsZero-config. Set the environment variables listed above and connect the repository.
A multi-stage Dockerfile is included, producing a standalone image with no build toolchain.
Builds to a standard Node server. Nothing depends on a platform-specific runtime.
| Technology | Versions | Status |
|---|---|---|
| Node.js | ≥ 22.12 | Supported |
| Edge runtime | any | Not supported Password hashing requires Node crypto. |
Beta. The API may change before 1.0.
Beta. The API may change before 1.0.
≥ 14WebAuthn as another AuthIdentity kind.
The SAML adapter has been exercised against two identity providers, which is not enough to call the interface settled. The version number says so rather than the marketing copy.
Curated by us, not inferred — these are the ones that genuinely pair with it.
Products that share a framework with this one.