@nauth-toolkit/storage-database
v0.2.5
Published
Database-backed session storage for nauth-toolkit
Downloads
532
Maintainers
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.
Part of nauth-toolkit. Requires
@nauth-toolkit/coreand a database package.
Install
npm install @nauth-toolkit/storage-databaseUsage
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.
