/license.xml, and rewriting the URL. This page focuses on CAP enforcement using the SDK directly.
SDK Setup
botDetector function to extend or override the built-in user-agent heuristics:
Option A: handleRequest (Recommended)
The handleRequest method handles the full lifecycle — bot detection, token extraction, verification, enforcement, and analytics recording — in one call. Pass an optional ExecutionContext if your runtime supports background tasks.
Option B: Manual Verification
For fine-grained control over responses or custom routing, useverifyAndRecord directly:
WWW-Authenticate and Link headers in the 401 responses follow the CAP specification and tell the crawler where to obtain a license.
Related Docs
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.