Files
zopu-code/.agents/skills/multiplayer-game/reference/deploy/cloudflare.md
2026-07-22 00:21:04 +05:30

1.6 KiB

Deploying to Cloudflare Workers

Source: src/content/docs/deploy/cloudflare.mdx Canonical URL: https://rivet.dev/docs/deploy/cloudflare Description: Deploy an existing Rivet project to Cloudflare Workers.


This guide covers deploying an existing Rivet project to Cloudflare Workers.

Prerequisites

Steps

Set up your project

Follow the Cloudflare Workers Quickstart to set up your project locally.

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:sk_...@api.rivet.dev"
RIVET_PUBLIC_ENDPOINT = "https://your-namespace@api.rivet.dev"

Deploy

npx wrangler deploy

Register the Serverless Runner URL

After deploy, set the Worker URL with the /api/rivet path as the serverless runner URL in Rivet.

Source doc path: /docs/deploy/cloudflare