Installation
Prerequisites
- A Xenarch publisher account
- A registered site with site token and site ID
- Your access token secret (from site registration)
Pattern 1: Site-wide middleware
Gates all bot traffic across your application:Parameters
Pattern 2: Per-route decorator
Gates individual routes:The decorated function must accept a
request: Request parameter.How it works
- Checks
User-Agentagainst known bot signatures - If bot: checks
Authorization: Bearerheader for a valid access token - Valid token: verifies HMAC signature, checks expiry, checks site_id — all local, no API call
- No token: calls
POST /v1/gatesto create a gate, returns HTTP 402