MonetizationOS Docs
Getting StartedProxy Quickstart

Cloudflare Proxy Worker

The MonetizationOS Cloudflare proxy worker is an open source integration that adds server-side monetization decisions to static or edge-served HTML.

View on GitHub

Deploy to Cloudflare

What is a Cloudflare Worker?

A Cloudflare Worker is serverless JavaScript or TypeScript that runs on Cloudflare's global edge network, close to your users.

Why use the proxy worker?

The MonetizationOS proxy worker lets you evaluate and apply monetization behavior at the edge before HTML reaches the browser.

Installation and configuration

1. Deploy or fork the worker

2. Configure required variables

Set these in Cloudflare bindings (wrangler.jsonc) or local dev vars:

VariableDescription
MONETIZATION_OS_SECRET_KEYYour MonetizationOS secret key. Get it from environment settings.
ORIGIN_URLThe base URL of your origin server.
SURFACE_SLUGThe MonetizationOS surface to evaluate for every HTML request.
AUTHENTICATED_USER_JWT_COOKIE_NAMECookie name containing the authenticated user's JWT.
ANONYMOUS_SESSION_COOKIE_NAMECookie name for anonymous session identifiers.

For optional variables and advanced configuration, see the Cloudflare Proxy Worker reference.

3. Run locally

npm install
npm run dev

4. Deploy

npm run deploy

For canonical setup details and updates, see the project README.

Next steps

On this page