Adopt One Package at a Time
On this page
You do not need to scaffold a new repository to use Dads. Every framework capability ships as a standalone npm package you can install inside an existing Express, Fastify, Hono, Next.js, or Node.js TypeScript project.
1. Add Postgres ReBAC to an existing app
If you already run PostgreSQL and want Zanzibar-style relationship permissions without operating a second database or an authorization outbox, install @dads-framework/access and @dads-framework/postgres-access:
npm install @dads-framework/access @dads-framework/postgres @dads-framework/postgres-access zod
- Declare entities, roles, and permissions in TypeScript with
entityHandle,access, andaccessModel. - Apply
relationshipSchemaMigration.sqlthrough your existing migration runner. - Instantiate
PostgresAuthorizationwith yourpg.Pooland runcheck,lookupResources, orwithProtectedPostgresTransaction.
See Permissions in Postgres & SpiceDB for the complete walkthrough, or the @dads-framework/postgres-access package page for a standalone runnable script.
2. Replace hand-written SpiceDB .zed files
If your team already operates SpiceDB and wants compile-time checking instead of raw .zed files and string permission names, install @dads-framework/access alone (zero database dependencies):
npm install @dads-framework/access zod
Author your model in TypeScript, emit .zed with emitZed(model), and compare your committed schema file against emitZed(model) in CI. See @dads-framework/access for a runnable schema-generation script, and @dads-framework/authorization when you also want a typed SpiceDB runtime client bound to the same model.
3. Add fail-closed HTTP routes and OpenAPI 3.1
Install @dads-framework/http and @dads-framework/contract to declare Fastify routes where every verb requires an explicit access rule, rejects unauthorized requests before input validation, and generates OpenAPI 3.1 directly from Zod schemas:
npm install @dads-framework/http @dads-framework/contract zod
Read Routes, Contracts & Clients to wire your first route group.
4. Add boundary checks and Doctor to any TypeScript repo
The Dads CLI can inspect an existing repository without rewriting your folder layout:
npx @dads-framework/toolbox doctor
To add an isolated Dads workspace beside an existing codebase, run:
npm create dads@latest . -- --existing
This writes the starter inside a dads/ subdirectory and leaves your existing files untouched.
Standalone package catalog
| Capability | Packages |
|---|---|
Relationship permission model and .zed emitter |
@dads-framework/access |
| Transactional PostgreSQL ReBAC engine | @dads-framework/postgres-access |
| SpiceDB runtime client and outbox | @dads-framework/authorization |
| Typed HTTP routes, guards, and OpenAPI 3.1 | @dads-framework/http, @dads-framework/contract |
| Auth, sessions, workspaces, SSO, and SCIM | @dads-framework/identity, @dads-framework/tenants |
| Audit trail, feature flags, jobs, storage, PDF, CSV | Browse all packages |