Quick Deploy (Click-to-Deploy)
The fastest way to deploy any experiment is using Cloudflare’s one-click deployment:1
Choose an experiment
Navigate to any experiment page and click the “Deploy to Cloudflare Workers” button.Each experiment README includes a deploy button linking to its source code.
2
Authenticate with Cloudflare
Sign in to your Cloudflare account or create one if you don’t have an account.The deployment system will request permissions to deploy Workers on your behalf.
3
Configure resources
Some experiments require additional resources:
- D1 databases: Created automatically during deployment
- KV namespaces: Created automatically
- R2 buckets: Created automatically
- Browser Rendering: Enabled automatically (requires plan upgrade)
- Workers AI: Enabled automatically (requires plan upgrade)
4
Deploy
Click the final deploy button. Your Worker will be deployed to a
*.workers.dev subdomain.The deployment typically completes in 10-30 seconds.Deployment URL Format
Click-to-deploy URLs follow this pattern:To deploy from your own fork, replace
shrinathsnayak with your GitHub username in the deployment URL.Manual Deployment
For more control or local development, deploy manually using Wrangler CLI.- Prerequisites
- Basic Experiments
- Workers AI
- Browser Rendering
- D1 + KV
- R2 Storage
Install the required tools:Clone the repository:
Custom Domains
Add a custom domain to any deployed Worker:1
Add domain to Cloudflare
Ensure your domain is already added to Cloudflare and using Cloudflare nameservers.
2
Navigate to Workers & Pages
In the Cloudflare dashboard:
- Go to Workers & Pages
- Select your deployed Worker
- Click the Triggers tab
3
Add custom domain
- Click Add Custom Domain
- Enter your subdomain (e.g.,
api.example.com) - Click Add Custom Domain
Environment Variables
Some experiments require environment variables. Set them in the dashboard or via Wrangler:- Dashboard
- Wrangler CLI
- Go to Workers & Pages
- Select your Worker
- Go to Settings → Variables
- Add variables (Plain text or Secret)
- Click Save
Deployment Checklist
1
Verify local functionality
2
Check TypeScript
3
Create required resources
- D1 databases
- KV namespaces
- R2 buckets
- Set environment variables
4
Run migrations (if applicable)
5
Deploy
6
Test production
Troubleshooting
Deployment Fails
- Authentication error: Run
wrangler loginto re-authenticate - Missing binding: Check
wrangler.jsonfor correct binding configuration - TypeScript errors: Run
npm run buildto identify issues
Runtime Errors
- AI binding not found: Ensure Workers AI is enabled on your account
- Browser binding not found: Enable Browser Rendering in your account
- Database not found: Check D1 database_id in
wrangler.json - KV not found: Check KV namespace id in
wrangler.json - R2 not found: Verify bucket names in
wrangler.json
Local Development Issues
- AI doesn’t work locally: Use
npm run dev -- --remotefor Workers AI - Browser doesn’t work locally: Use
npm run dev -- --remotefor Browser Rendering - R2 public URLs don’t work: Use
npm run dev -- --remoteto test with real R2
Production Best Practices
Use Environment Variables
Store sensitive values as secrets, not in code:
Set Rate Limits
Use Cloudflare’s Rate Limiting to prevent abuse:Configure in the Cloudflare dashboard under Security.
Monitor Usage
Track Worker invocations and errors:Workers & Pages → Your Worker → Metrics
Enable Analytics
Use Workers Analytics for detailed insights:Available on Workers Paid plan
Next Steps
Explore Experiments
Browse all available experiments
Architecture Patterns
Learn common patterns used across experiments