/license.xml and enforces the Crawler Authentication Protocol (CAP) on all other traffic — everything stays on your domain.
This flow uses the Wrangler CLI. Install it and authenticate once before you start:
Project Setup
Worker
The Worker branches on the request path:/license.xml is proxied to the Supertab Connect API (keeping the URL on your domain), and every other request goes through CAP verification.
ctx — the SDK uses its waitUntil to send events in the background without blocking the response: license-usage events whenever a token is verified, plus analytics events when analyticsEnabled is set.
If your Worker isn’t on your origin’s hostname (for example, it proxies to a separate backend), pass an
originUrl option so the SDK forwards allowed traffic there. Deployments using Workers Routes on your own domain can omit it — fetch(request) already resolves to your origin via Cloudflare’s edge.Wrangler Configuration
A single route sends all traffic on your domain to the Worker:nodejs_compat flag is required for the SDK to function. Find your zone_id in the Cloudflare dashboard under your domain → Overview, in the API section.
API Key Secret
Store your Merchant API key (from the Supertab Connect dashboard) as a Worker secret:env object at runtime.
Deploy
wrangler dev for local preview before deploying to production.
Enforcement Modes
Setenforcement in the handler options:
Start in
OBSERVE while you validate the integration, then move to ENFORCE when you’re ready to block.
Analytics & Bot Classification
Analytics is off by default. PassanalyticsEnabled: true (shown above) to emit an event for every bot request the Worker sees. Events are sent to Supertab Connect in the background — no additional Cloudflare configuration or log streaming is required.
These events are what power bot classification and traffic reporting in your Supertab Connect dashboard. Without analyticsEnabled: true, the Worker still enforces CAP, but records nothing — your dashboard shows no bot activity.
Test
Confirm the license is served — visithttps://yourdomain.com/license.xml; you should see your RSL license with your domain in the URL bar.
Confirm CAP is enforcing — visit https://yourdomain.com in your browser and you should see your normal homepage, unaffected. Then send a request with an invalid token:
401 invalid-token response, confirming CAP is verifying license tokens at the edge.
Purge Cached License
No action needed. Cloudflare serves the latestlicense.xml immediately after you publish a new version — there is no cache to invalidate. Confirm the update at https://yourdomain.com/license.xml.
Related Docs
Deploy in Your CDN
CDN-agnostic guide covering RSL serving, CAP enforcement, and robots.txt.
Other CDNs
Generic CDN patterns for platforms not listed above.