Skip to content
Night Owls.dev
Jump to a page

@nightowlsdev/auth-sessions

Auth

A small, pg-backed revocable session store, logout, log-out-everywhere, and admin kill without shortening JWT TTLs.

What it does

@nightowlsdev/auth-sessions makes otherwise-stateless session JWTs REVOCABLE: a session is live only while its `jti` row exists, is not revoked, and is not expired, giving you logout, log-out-everywhere, and admin/abuse kill without shortening the token TTL. `makeSessionStore` runs parameterized queries against a `pg` Pool you provide (pg is a peer dependency, you own the Pool), and it ships the table DDL as an installable migration (`MIGRATIONS`). Server-only. Also exports the CLI plugin manifest.

Install

pnpm add @nightowlsdev/auth-sessions

Key exports

  • makeSessionStore
  • nightOwlsPlugin
  • MIGRATIONS

Usage

auth-sessions.ts
import * as pkg from "@nightowlsdev/auth-sessions";