JSPM

  • Created
  • Published
  • Downloads 234
  • Score
    100M100P100Q85465F
  • License SEE LICENSE

Database-backed session storage for nauth-toolkit

Package Exports

  • @nauth-toolkit/storage-database

Readme

@nauth-toolkit/storage-database

Database-backed storage adapter for nauth-toolkit.

Stores rate limit counters, account lockout state, and distributed locks in your existing database via TypeORM. No additional infrastructure required โ€” simpler than Redis for single-server deployments.

Documentation ยท GitHub

Part of nauth-toolkit. Requires @nauth-toolkit/core and a database package.


Install

npm install @nauth-toolkit/storage-database

Usage

Pass the adapter in your nauth config:

import { DatabaseStorageAdapter } from '@nauth-toolkit/storage-database';

const nauth = await NAuth.create({
  config: {
    ...authConfig,
    storageAdapter: new DatabaseStorageAdapter(),
  },
  dataSource,
  adapter: new ExpressAdapter(),
});

Add getNAuthTransientStorageEntities() to your TypeORM entities for the storage tables.


Also available

Package Purpose
@nauth-toolkit/storage-redis Redis โ€” recommended for production and multi-instance deployments

See the full package list in the core README.


Free to use. See license.