@deeblr/auth-adapter-memory
v0.4.0
Published
A real, in-process DatabaseAdapter reference implementation for Deeblr Auth: full DatabaseAdapter contract, UserRepository extensions (search/soft-delete/batch), sessions, and transactions. Good for development and tests; not durable across restarts or sh
Readme
@deeblr/auth-adapter-memory
A real, fully-functional in-process DatabaseAdapter reference
implementation for Deeblr Auth. Not a placeholder — implements the base
contract plus UserRepository extensions (search, soft-delete, batch) and
real transactions (via snapshot/rollback of its internal state).
Install
npm install @deeblr/auth-adapter-memoryUsage
import { DeeblrAuth } from "@deeblr/auth";
import { MemoryDatabaseAdapter } from "@deeblr/auth-adapter-memory";
const auth = new DeeblrAuth({
adapter: new MemoryDatabaseAdapter(),
secret: process.env.AUTH_SECRET,
});What it supports
searchUsers, countUsers, softDeleteUser/restoreUser,
batchCreateUsers/batchUpdateUsers/batchDeleteUsers, transaction()
(real rollback on a thrown error), and the full session contract.
Limitation
State lives in process memory only — lost on restart, not shared across
instances/processes. Good for local development, tests, and demos. For
anything durable, use @deeblr/auth-adapter-sqlite or a real database
adapter (see @deeblr/auth-adapter-kit's README for how to build one).
Testing
Passes the full @deeblr/auth-adapter-kit conformance suite with zero
skips (every capability it declares is genuinely implemented):
npm testLicense
MIT
