Cloudflare Worker Setup
Deploy the RenderBeam Worker that detects bots and serves cached HTML from the Cloudflare edge.
Prerequisites
About 10–15 minutes the first time.
- A verified domain in RenderBeam
- A free Cloudflare account
- DNS for the domain pointed at Cloudflare (any plan, including free)
Download the worker
In Domains → your project → Setup, click Download worker.js. The file is pre-configured with your project ID and API key endpoint.
Create the Cloudflare Worker
- Cloudflare dashboard → Workers & Pages → Create → Create Worker.
- Name it (e.g.
renderbeam-worker) and deploy the placeholder. - Edit code → replace everything with the downloaded
worker.js. - Deploy.
Configure environment variables
Settings → Variables. Add two encrypted variables:
| Name | Value |
|---|---|
RENDERBEAM_API_KEY | Your project API key (from the dashboard) |
RENDERBEAM_PROJECT_ID | Your project ID |
Both are required — the renderer rejects requests missing x-api-key or x-project-id.
Set up routes
Triggers → Routes → Add route:
*yourdomain.com/*Attach to the zone for your domain.
Verify deployment
Click Test bot render in the RenderBeam dashboard, or:
curl -A "Googlebot" -I https://yourdomain.comLook for X-Rendered-By: RenderBeam and X-Cache-Status: HIT|MISS.
Loop prevention header
Our renderer fetches your origin with the header X-RenderBeam-Skip: true. The worker is configured to always pass through any request carrying this header, so the renderer never accidentally calls itself. Don't strip this header in any custom logic.
Troubleshooting
- Worker not triggering — route pattern must include the wildcard prefix
*and end with/*. - 401 / 403 from renderer — check both
RENDERBEAM_API_KEYandRENDERBEAM_PROJECT_IDare set and encrypted. - Real users see errors — RenderBeam is fail-open by design; the worker passes through to your origin if rendering fails. If users still see errors, your origin itself is failing — see Fail-open behavior.
- Bot not detected — verify the bot is enabled in Bots for the project; trial accounts are locked to the Standard preset.
Was this page helpful?