Installation
pnpm add @smplcty/auth @smplcty/db pgpgis a peer dependency.@smplcty/dbprovides the transaction primitive (withTransactionis re-exported from it).
Optional sign-in handlers
Section titled “Optional sign-in handlers”Sign-in handlers are opt-in subpaths with their own optional peers — auth
core depends on neither oauth4webapi nor Twilio, so a password-only app pulls
neither.
# OIDC (org-bound):pnpm add oauth4webapi # → import { oidcHandler } from '@smplcty/auth/oidc'
# Twilio Verify OTP (user-bound):pnpm add @smplcty/twilio # → import { twilioVerifyHandler } from '@smplcty/auth/twilio'Subpath exports
Section titled “Subpath exports”| Import | Purpose |
|---|---|
@smplcty/auth | core: withSession, session lifecycle, identity setters, createMethodRouter, errors, types |
@smplcty/auth/oidc | the oidcHandler (needs oauth4webapi) |
@smplcty/auth/twilio | the twilioVerifyHandler (needs @smplcty/twilio) |
@smplcty/auth/flat-tenant | the flatTenantScope preset |
@smplcty/auth/http | the HTTP transport tier — Web-standard /auth/* handlers (no new deps) |
Schema
Section titled “Schema”The library ships its schema as schema-flow YAML under @smplcty/auth/schema/
and consumes generic mixins from @smplcty/schema-std. See
Required database schema.
Continue to Quick start.