Skip to content

@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 KV
const session = await verifySession(token, env.KV_SESSION);
// Create a new session
const token = await createSession({ userId, tenantId }, env.KV_SESSION);

Configuration

BindingDescription
KV_SESSIONCloudflare KV namespace for session storage

Notes

  • Sessions expire after SESSION_TTL_SECONDS (default 86400).
  • JWT signing uses the Worker’s INTERNAL_SIGNING_KEY secret.