AI journaling companion powered by Cloudflare Agents and Anthropic Claude.
npm installCreate a .dev.vars file in the project root for local development:
ANTHROPIC_API_KEY=sk-ant-api03-your-key-here
CF_AIG_TOKEN=your-cloudflare-ai-gateway-token
ADMIN_API_KEY=replace-with-a-strong-admin-key
USER_API_KEYS_JSON={"alice":"replace-with-user-key"}
# Optional fallback/global key:
# API_KEY=replace-with-global-key
# Optional CORS allowlist:
# CORS_ALLOWED_ORIGINS=https://app.example.com,http://localhost:3000
# Optional Gemini gateway override:
# CF_AI_GATEWAY_BASE_URL=https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/google-ai-studio/v1beta
Get your Anthropic API key from console.anthropic.com/settings/keys.
For production, use:
npx wrangler secret put ANTHROPIC_API_KEYnpm run devStarts the local server on http://localhost:8787.
| Endpoint | Protocol | Description |
|---|---|---|
/agents/journal-agent/{userId} |
WebSocket | Chat with the journal agent |
/agents/journal-agent/{userId} |
RPC | Call generateSummary() for session recap |
/health |
HTTP GET | Health check |