Quickstart
Cloudflare Workers Quickstart
Get started with Rivet Actors on Cloudflare Workers with Durable Objects
Install Rivet
Command Line
Create an Actor
Create a simple counter actor:
registry.ts
Setup Server
Choose your preferred web framework:
Run Server
Configure your wrangler.json for Cloudflare Workers:
wrangler.json
Start the development server:
Command Line
Your server is now running at http://localhost:8787
Test Your Actor
Test your counter actor using HTTP requests:
Deploy to Cloudflare Workers
Deploy to Cloudflare's global edge network:
Command Line
Your actors will now run on Cloudflare's edge with persistent state backed by Durable Objects.
See the Cloudflare Workers deployment guide for detailed deployment instructions and configuration options.
Configuration Options
Connect Frontend To The Rivet Actor
Create a type-safe client to connect from your frontend:
client.ts
See the JavaScript client documentation for more information.
Cloudflare Workers mounts the Rivet endpoint on /rivet by default.