REST API caching proxy for Nostr, running on Cloudflare Workers.
- Read acceleration: Cache Nostr queries with CDN + KV caching
- Write proxy: Reliable event publishing with verification and retries
- NIP-98 auth: Authenticated writes via HTTP Authorization
- Edge deployment: Global distribution via Cloudflare Workers
GET /query?filter=<base64url-encoded-filter>
Filter is a base64url-encoded JSON Nostr filter:
{"authors": ["pubkey"], "kinds": [1], "limit": 20}GET /profile/{pubkey} - Get kind 0 profile
GET /event/{id} - Get single event by ID
POST /publish
Authorization: Nostr <base64-nip98-event>
Content-Type: application/json
{"event": {...signed nostr event...}}
GET /publish/status/{event_id}
# Install wrangler
npm install -g wrangler
# Create KV namespace
wrangler kv:namespace create REST_GATEWAY_CACHE
wrangler kv:namespace create REST_GATEWAY_CACHE --preview
# Update wrangler.toml with namespace IDs
# Create queues
wrangler queues create divine-publish-events
wrangler queues create divine-publish-failed
# Run locally
wrangler dev
# Deploy
wrangler deploySet RELAY_URL in wrangler.toml vars or as a secret:
wrangler secret put RELAY_URLMIT