rhythia-api
v242.0.0
Published
This repo is a typed wrapper around Rhythia's backend endpoints. The helpers under `api/` are wired through `handleApi.ts` so consumers can call functions like `acceptInvite` or `createCollection` and let the shared client post to the hosted service while
Readme
Rhythia Online API
This repo is a typed wrapper around Rhythia's backend endpoints. The helpers under api/ are wired through handleApi.ts so consumers can call functions like acceptInvite or createCollection and let the shared client post to the hosted service while censoring stray profanity in responses.
The deploy target is Cloudflare Workers. worker.ts dispatches the existing api/*.ts handlers, keeps the old /api/* paths, and applies the same CORS policy the old deployment used.
Local development uses Wrangler and reads secrets from the existing .env file. Install dependencies, then run yarn dev. Deploy with yarn deploy. For production, mirror the same keys in the Cloudflare dashboard or with Wrangler secrets.
Runtime secrets live in environment variables. Upload endpoints expect ACCESS_BUCKET and SECRET_BUCKET for S3, the purchase flow checks BUY_SECRET, auth helpers derive tokens from TOKEN_SECRET, and the Supabase admin calls need ADMIN_KEY. Score ingestion also still expects the Redis credentials already used by submitScoreInternal.
If you need to point at a different stack, call setEnvironment with development, testing, or production before making requests so the helper talks to the right Rhythia host.
