@core-labs/auth-kit
Purpose
Provides verifySession, createSession, and JWT helpers for the core-platform and edge-api-gateway Workers.
Public API
import { verifySession, createSession } from "@core-labs/auth-kit";
// Verify a session token from KVconst session = await verifySession(token, env.KV_SESSION);
// Create a new sessionconst token = await createSession({ userId, tenantId }, env.KV_SESSION);Configuration
| Binding | Description |
|---|---|
KV_SESSION | Cloudflare KV namespace for session storage |
Notes
- Sessions expire after
SESSION_TTL_SECONDS(default 86400). - JWT signing uses the Worker’s
INTERNAL_SIGNING_KEYsecret.