Before you start
Access to your domain’s Cloudflare account and permission to create a token. Enable Web Analytics for visitor reports; basic request counts include bots.
Set it up
- Open Cloudflare → profile icon → My Profile → API Tokens.
- Create Token → Custom token → Get started, named
Sprid. - Permissions:
- Zone → Analytics → Read
- Account → Account Analytics → Read
- Zone Resources → Include → Specific zone: your domain.
- Account Resources → Include: your account.
- Leave Client IP Address Filtering and TTL empty. Continue to summary → Create Token.
- Save the token to a private file such as
~/keys/cloudflare-sprid.txt. It is shown once.
For a connection that survives you leaving the team, create an account-owned token instead under Manage Account → Account API Tokens, with the same permissions.
Zone id
Your domain → Overview → API card: copy Zone ID and Account ID. The Zone ID goes in the command; ask your agent to save the Account ID in your Sprid app profile.
Connect to Sprid
sprid connect cloudflare --token ~/keys/cloudflare-sprid.txt --zone 0123456789abcdef0123456789abcdef Use your own file path and Zone ID. Keep the token out of chat.
Check the connection
Run sprid status, then ask your agent: “Check that Sprid can read recent Cloudflare traffic for this domain.” The check names the domain and says whether visitor reports or only request counts are available.
If something goes wrong
- Access denied: API Tokens → ⋯ → Edit. Check both Read permissions and the selected domain and account.
- Domain not found: use the Zone ID, not the domain name.
- Visitor reports are empty: enable Analytics & Logs → Web Analytics and check the tracking snippet is on your site.
Investigate with this connection
Reads rum and http. RUM is pinned to the saved account and hostname; beacon traffic is sampled and not verified human.
sprid marketing-review capabilities --app <slug> --source cloudflare --json See connected queries.
Sources and verification
Prefer your terminal? sprid docs cloudflare reads this same guide.