Documentation Index
Fetch the complete documentation index at: https://docs.searchable.com/llms.txt
Use this file to discover all available pages before exploring further.
What this does
The Worker sits at Cloudflare’s edge in front of your origin. For every inbound request it:- Lets the request flow through to your origin unchanged (no added latency for users)
- Checks the user agent against Searchable’s AI-bot registry
- If it matches, fires a fire-and-forget POST to Searchable with the request metadata
Works on any Cloudflare plan, including Free. Most sites stay well within the Workers free tier (100k requests/day). High-traffic sites can upgrade to Workers Paid for a few dollars a month.
Prerequisites
A Cloudflare account with your domain on it (the domain doesn’t have to be on a paid plan)
Permission to deploy Workers and add Worker routes to your zone
A Searchable project with your domain confirmed
Setup
Generate the Worker script in Searchable
- Open your Searchable dashboard
- Go to Agent Analytics → Setup
- Pick Cloudflare Worker as your crawler source
- Click Generate token
Create a new Worker in Cloudflare
Open dash.cloudflare.com → Workers & Pages → Create.
- Pick the Hello World template
- Name it (e.g.
searchable-tracker) - Click Deploy
Paste the Worker script
From the new Worker’s overview page:
- Click Edit code
- Replace the entire file contents with the script you copied from Searchable
- Click Save and deploy
Bind the Worker to your domain
A Worker by itself isn’t on your domain — it has its own
*.workers.dev URL. To make it observe your real traffic, add a route.From the Worker’s Settings tab:- Open Domains & Routes (older UIs label this Triggers)
- Click Add → Route
- Enter your route, e.g.
*yourdomain.com/*(the leading*matches all subdomains) - Pick your zone and save
Reference: Worker script
If you’d rather not copy the script from the Searchable UI, here’s the reference. ReplaceINTEGRATION_TOKEN with the token you generated.
worker.js
- It never blocks the response. The forward to Searchable is
ctx.waitUntil(...), so even if Searchable is unreachable, your users see no slowdown. - It fails open. While the bot registry is loading (cold start) the Worker forwards every request and lets Searchable’s server-side classifier do the filtering. Once the registry loads, it filters at the edge to cut traffic.
- Static assets are skipped. CSS, JS, images, fonts, and video bypass the Worker entirely — those almost never come from AI crawlers, and there’s no point burning a Worker invocation on each.
Storing the token as a secret (recommended)
For tighter security, store the token as a Worker secret instead of leaving it inline.- In your Worker, open Settings → Variables and Secrets
- Add a secret named
INTEGRATION_TOKENwith yoursa_…token as the value - In the script, blank the inline
INTEGRATION_TOKENconstant:const INTEGRATION_TOKEN = ""; - Redeploy
Cost
Each AI-bot request costs you one extra Worker invocation. The Workers Free plan includes 100,000 requests per day — that’s about 3 million crawls per month, which covers nearly all sites. If you exceed it, the Workers Paid plan is $5/month for 10 million requests. The Worker itself does no CPU-intensive work (a regex check and afetch call), so CPU time is negligible.
Troubleshooting
Status stays on 'Waiting for first event'
Status stays on 'Waiting for first event'
Most likely the route isn’t bound correctly.Then click Check in Searchable. If that doesn’t appear in the dashboard, the Worker’s logs (Cloudflare → Worker → Logs) will show whether
- In Cloudflare, open the Worker → Settings → Domains & Routes
- Confirm the route pattern matches your live domain (e.g.
*yourdomain.com/*, not*yourdomain.dev/*) - Confirm the route’s Zone is the zone that’s actually serving traffic for the domain
forwardToSearchable is running and whether Searchable returned a non-2xx status.Worker logs show 401 from Searchable
Worker logs show 401 from Searchable
The token is missing or wrong.
- Confirm
INTEGRATION_TOKEN(inline) or the secret namedINTEGRATION_TOKENis set to asa_…value - If you’ve recently revoked the token in Searchable, generate a new one and update the Worker
- The token must have no quotes around it in the secret value
My site is fronted by Cloudflare but I don't manage the zone
My site is fronted by Cloudflare but I don't manage the zone
You need permission to add Worker routes on the zone. If you don’t have it:
- Ask the zone admin to add the route, or
- Use the custom REST API path from your application server
I see double-counted events
I see double-counted events
If you also have Cloudflare Logpush sending traffic to Searchable, you’ll get the same request from both sources. Searchable de-duplicates server-side using the Cloudflare Ray ID, so the dashboard shows each request once. If you’d rather not run both, pick one and disable the other.
Removing the integration
- Cloudflare → Worker → Settings → Domains & Routes → remove the route (the Worker stops observing traffic)
- Optionally delete the Worker itself
- Searchable → Agent Analytics → Setup → Tokens → revoke the token
Next steps
Cloudflare Logpush
On the Enterprise plan? See the native Logpush path.
See the data
Open Agent Analytics to see which assistants are crawling your site.