@~lyre/auth
v0.0.9
Published
Shared Axis Accounts auth SDK — framework-agnostic session/identity core (HMAC-signed cookies, accounts login/callback/logout) plus an optional turnkey SvelteKit adapter.
Downloads
918
Maintainers
Readme
@~lyre/auth
Shared Axis Accounts auth SDK. A small, framework-agnostic core for session and identity handling (HMAC-signed cookies, the accounts login → callback → logout exchange, tenant resolution), plus an optional turnkey SvelteKit adapter that wires it all up in a few lines.
Ships as raw TypeScript source.
Install
pnpm add @~lyre/auth # or: npm i / yarn addEntry points
@~lyre/auth — framework-agnostic core
Session, identity and accounts primitives — usable from any Node runtime:
import {
createPlatformAuth,
beginAccountsLoginRedirect,
handleAccountsCallback,
readPlatformSessionCookie,
clearPlatformSessionCookie,
resolveActiveTenant,
syncAccountsUser,
type PlatformSession,
type AccountsIdentity,
} from '@~lyre/auth';The core depends only on node:crypto — no framework required.
@~lyre/auth/sveltekit — turnkey SvelteKit adapter
A single handle that reads the session into event.locals, serves
/auth/login, /auth/callback and /auth/logout inline (no route files), and
optionally gates protected paths:
// src/hooks.server.ts
import { createAuthHandle } from '@~lyre/auth/sveltekit';
export const handle = createAuthHandle({
// ...SvelteKitAuthOptions
});@sveltejs/kit is an optional peer dependency — only required if you import
the /sveltekit entry.
Publishing
See PUBLISHING.md. Published to npm via GitHub Actions Trusted Publishing on version bump.
