For the complete documentation index, see llms-docs.txt or the site index llms.txt. Full docs corpus: llms-full-docs.txt. Prefer the markdown version of this page at /docs/setup/backend/api-key.md. Product capabilities: skill.md. Docs MCP: /docs/mcp. Site MCP: /mcp.

API Key

Set up, configure, and run the Reloop API key microservice locally.

Generation, hashing, validation, and revocation of developer API keys.

Run bun setup once from the monorepo root. Env files come from bun setup / bun env:setup.

Overview

PropertyValue
Directoryapps/backend/api-key
Port8012
Local URLhttps://local.reloop.sh/api/api-key
Swagger UIhttps://local.reloop.sh/api/api-key/openapi
StackElysiaJS · Better Auth API Key · PostgreSQL · Redis · NATS

Quick start

bun be:api-key:dev

Or bun backend:dev / bun dev.

Environment

apps/backend/api-key/.env — from bun setup / bun env:setup.

PG_URL=postgresql://reloop:reloop123@localhost:5432/reloop
REDIS_URL=redis://:reloop123@localhost:6379
PORT=8012
BASE_URL="https://local.reloop.sh"
NATS_URL=nats://localhost:4222
NODE_ENV=development
VariableRequiredDefault
PG_URLYESpostgresql://...
REDIS_URLYESredis://...
PORTYES8012
BASE_URLYEShttps://local.reloop.sh
NATS_URLYESnats://localhost:4222

Commands

CommandDescription
bun be:api-key:devStart dev server with hot reloading
bun run --filter=be-api-key buildCompile production bundle
bun run --filter=be-api-key startRun compiled production build
bun run --filter=be-api-key check-typesTypeScript type-check

Architecture

LayerDetail
Auth@better-auth/api-key handles SHA-256 hashing and key formatting
CachingValidated keys are cached in Redis for fast lookups
EventsKey lifecycle events published to NATS under api-key.*
Schemaapikey table in packages/db/src/schema/api-key.ts

Next

Was this page helpful?

Edit this page