website/src/content/docs/deploy/cloudflare.mdx
This guide covers deploying an existing Rivet project to Cloudflare Workers.
wrangler configured for your accountFollow the Cloudflare Workers Quickstart to set up your project locally.
</Step> <Step title="Configure Wrangler">Set your Rivet connection values as Worker variables. Find RIVET_ENDPOINT and RIVET_PUBLIC_ENDPOINT in the Rivet Dashboard under Settings → Namespace → Advanced → Backend Configuration and copy them in.
name = "rivetkit-cloudflare"
main = "src/index.ts"
compatibility_date = "2025-04-01"
compatibility_flags = ["nodejs_compat"]
[vars]
RIVET_ENDPOINT = "https://your-namespace:[email protected]"
RIVET_PUBLIC_ENDPOINT = "https://[email protected]"
npx wrangler deploy
After deploy, set the Worker URL with the /api/rivet path as the serverless runner URL in Rivet.