Skip to main content
If your CDN is not Fastly, CloudFront, or Cloudflare, use the generic SDK API to build your own integration. The Deploy in Your CDN guide covers the general pattern for RSL license serving — adding an origin, routing /license.xml, and rewriting the URL. This page focuses on CAP enforcement using the SDK directly.

SDK Setup

Bot detection is configured at construction time. Pass a botDetector function to extend or override the built-in user-agent heuristics:
Analytics is off by default. Set analyticsEnabled: true to emit one event per request to Supertab Connect — this is what powers bot classification and traffic reporting in your dashboard. Enforcement is separate: it decides whether unlicensed requests are allowed or blocked.

The handleRequest method handles the full lifecycle — bot detection, token extraction, verification, enforcement, and analytics (when enabled) — in one call. It returns the correct 401/403 response with the WWW-Authenticate and Link headers automatically. Pass an ExecutionContext via the ctx option if your runtime supports background tasks, so event recording never blocks the response.

Option B: Manual Verification

For fine-grained control over responses or custom routing, use verifyAndRecord directly:
The WWW-Authenticate and Link headers in the 401 responses follow the CAP specification and tell the crawler where to obtain a license.

Deploy in Your CDN

General deployment guide covering RSL serving, CAP, and robots.txt.

SDK Overview

Full API reference for all SDK methods across languages.