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.
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
- One-click deploy to Cloudflare
- Or fork the repo to customize your own deployment pipeline.
2. Configure required variables
Set these in Cloudflare bindings (wrangler.jsonc) or local dev vars:
| Variable | Description |
|---|---|
MONETIZATION_OS_SECRET_KEY | Your MonetizationOS secret key. Get it from environment settings. |
ORIGIN_URL | The base URL of your origin server. |
SURFACE_SLUG | The MonetizationOS surface to evaluate for every HTML request. |
AUTHENTICATED_USER_JWT_COOKIE_NAME | Cookie name containing the authenticated user's JWT. |
ANONYMOUS_SESSION_COOKIE_NAME | Cookie name for anonymous session identifiers. |
For optional variables and advanced configuration, see the Cloudflare Proxy Worker reference.
3. Run locally
npm install
npm run dev4. Deploy
npm run deployFor canonical setup details and updates, see the project README.
Next steps
- Learn the broader concept and architecture in Proxies
- Explore the request pipeline in the Proxy API reference