@nauth-toolkit/database-typeorm-postgres
v0.2.5
Published
PostgreSQL storage adapter for nauth-toolkit via TypeORM
Downloads
523
Maintainers
Readme
@nauth-toolkit/database-typeorm-postgres
PostgreSQL database adapter for nauth-toolkit.
Provides TypeORM entity definitions for all auth tables — users, sessions, MFA devices, social accounts, audit logs, and more. Plug into your existing TypeORM DataSource and nauth-toolkit manages the rest.
Part of nauth-toolkit. Requires
@nauth-toolkit/core.
Install
npm install @nauth-toolkit/core @nauth-toolkit/database-typeorm-postgresUsage
import { DataSource } from 'typeorm';
import { getNAuthEntities } from '@nauth-toolkit/database-typeorm-postgres';
const dataSource = new DataSource({
type: 'postgres',
url: process.env.DATABASE_URL,
entities: getNAuthEntities(),
synchronize: true, // dev only
});Use getNAuthEntities() in your TypeORM config. If using DatabaseStorageAdapter, also add getNAuthTransientStorageEntities().
Also available
| Package | Purpose |
| --- | --- |
| @nauth-toolkit/database-typeorm-mysql | MySQL / MariaDB — same structure, different driver |
See the full package list in the core README.
Free to use. See license.
