Deployment
A single command deploys your Idyllic application to production:What Gets Deployed
Environment Variables
During development, store variables in.dev.vars (gitignored):
env object:
How It Works
Cloudflare Workers
Your code runs as a Cloudflare Worker using V8 isolates (the Chrome JavaScript engine). Unlike container-based serverless (Lambda, Cloud Functions), isolates cold-start in under 5ms. The cold start problem effectively disappears. Workers run in 300+ data centers. A user in Tokyo executes code in Tokyo. Scaling happens automatically. You pay for actual usage, not provisioned capacity.Durable Objects
Each conversation gets its own Durable Object instance. DOs provide:- Isolation: Conversations cannot share or corrupt each other’s state
- Persistence: State survives across requests; return hours later and history remains
- Single-threaded execution: One request at a time, no race conditions, no locks needed
- Geographic mobility: DOs can migrate closer to users as they move
WebSocket Connections
Clients connect via WebSocket. The Worker hands the connection to the appropriate Durable Object, which maintains it for the session duration. The DO receives messages, processes them through your system, and streams responses back. Cloudflare handles TLS, connection establishment, automatic reconnection, and rate limiting.Configuration
Theidyllic.json file controls deployment:
name determines your production URL (my-system.idyllic.run). The compatibility_date pins runtime API versions.
Multiple Environments
Monitoring
Logs
console.log output.
Metrics
Track request volume, latency (P50/P95/P99), active connections, storage usage, and error rates through the dashboard.Cost
Cloudflare Workers uses usage-based pricing:- Workers: First 100K requests/day free, then $0.50 per million
- Durable Objects: 0.20 per GB-month storage
Local vs Production
| Aspect | idyllic dev | idyllic deploy |
|---|---|---|
| Runtime | Local emulator (wrangler) | Global edge network |
| State | Local SQLite file | Durable Objects |
| URL | localhost:8787 | your-system.idyllic.run |
| Secrets | .dev.vars file | Encrypted env variables |