API Key
Set up, configure, and run the Reloop API key microservice locally.
Generation, hashing, validation, and revocation of developer API keys.
Overview
| Property | Value |
|---|---|
| Directory | apps/backend/api-key |
| Port | 8012 |
| Local URL | https://local.reloop.sh/api/api-key |
| Swagger UI | https://local.reloop.sh/api/api-key/openapi |
| Stack | ElysiaJS · 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
| Variable | Required | Default |
|---|---|---|
PG_URL | YES | postgresql://... |
REDIS_URL | YES | redis://... |
PORT | YES | 8012 |
BASE_URL | YES | https://local.reloop.sh |
NATS_URL | YES | nats://localhost:4222 |
Commands
| Command | Description |
|---|---|
bun be:api-key:dev | Start dev server with hot reloading |
bun run --filter=be-api-key build | Compile production bundle |
bun run --filter=be-api-key start | Run compiled production build |
bun run --filter=be-api-key check-types | TypeScript type-check |
Architecture
| Layer | Detail |
|---|---|
| Auth | @better-auth/api-key handles SHA-256 hashing and key formatting |
| Caching | Validated keys are cached in Redis for fast lookups |
| Events | Key lifecycle events published to NATS under api-key.* |
| Schema | apikey table in packages/db/src/schema/api-key.ts |
Next
Was this page helpful?
- Need help? Contact Support.
- Chat with Reloop developers on Discord.
- Check out our changelog.
- Questions? Contact Sales.
- LLM? Read llms.txt.