JSPM

  • Created
  • Published
  • Downloads 235
  • Score
    100M100P100Q94389F
  • License SEE LICENSE

PostgreSQL storage adapter for nauth-toolkit via TypeORM

Package Exports

  • @nauth-toolkit/database-typeorm-postgres

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.

Documentation ยท GitHub

Part of nauth-toolkit. Requires @nauth-toolkit/core.


Install

npm install @nauth-toolkit/core @nauth-toolkit/database-typeorm-postgres

Usage

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.