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
An Edge Function runs at Netlify’s edge in front of your origin. For every inbound request it:- Lets the request pass through to your origin unchanged (no added latency for users)
- After the response is returned, fires a fire-and-forget POST to Searchable with the request metadata
- Returns the original response to the visitor
Works on every Netlify plan, including Free. Netlify’s free plan covers 1M Edge Function invocations per month — well above typical bot traffic for most sites.
Prerequisites
A Netlify site with deploy access
A Searchable project with your domain confirmed
Setup
Generate an integration token in Searchable
- Open your Searchable dashboard
- Go to Agent Analytics → Setup
- Pick Netlify Edge Function as your crawler source
- Click Generate token
sa_… and won’t be shown again. You can always generate a new one if you lose it.Add the Edge Function file to your repo
Create the file The function intercepts every request, forwards a lightweight event to Searchable after the response is returned, and never blocks the user.
netlify/edge-functions/searchable.ts in your repository and paste the snippet below.netlify/edge-functions/searchable.ts
Add the environment variable in Netlify
In your Netlify site:Site settings → Environment variables → Add a variable
Make sure the variable name is exactly
| Key | Value |
|---|---|
SEARCHABLE_TOKEN | The sa_… token you generated above |
SEARCHABLE_TOKEN (all caps, underscore).Commit and push
Commit the new file and push to your main branch. Netlify will auto-deploy the edge function.
Verifying the connection
Return to Agent Analytics → Setup in your Searchable dashboard. The Netlify Edge Function card should flip to Connected within about 10 seconds of the next AI crawler hitting your site.| Status | What it means |
|---|---|
| Waiting for first event | The function is deployed but no AI bot has hit your site yet. Typical wait is a few hours for sites that are already indexed. |
| Connected | Events are arriving. The card shows the count from the last 24 hours. |
Cost
Each forwarded request consumes one Edge Function invocation. Netlify’s free plan covers 1M invocations per month — bot traffic is a tiny fraction of that for typical sites.Troubleshooting
Card stays 'Not connected' after deploying
Card stays 'Not connected' after deploying
Check these in order:
- The environment variable is named exactly
SEARCHABLE_TOKEN(all caps, underscore — notSearchableTokenorSEARCHABLE-TOKEN) - The deploy succeeded — check Netlify’s deploy log for errors in the edge function
- The function is active in Site settings → Edge functions
- The
configexport at the bottom of the file setspath: "/*"so the function runs on all requests
I only see human traffic, not bots
I only see human traffic, not bots
That’s expected. Searchable filters non-bot user agents server-side — only AI crawlers (GPTBot, ClaudeBot, PerplexityBot, etc.) are recorded in your dashboard. Human visitors are forwarded but immediately discarded.
Netlify logs show errors in the edge function
Netlify logs show errors in the edge function
If the function throws during
context.next(), Netlify may surface it in deploy logs. The forward() call is wrapped in a try/catch and uses context.waitUntil(...), so errors inside forward are silently swallowed and never affect your visitors.Confirm the function file is valid TypeScript and that the import type { Context } line is present — Netlify’s Deno runtime requires it.Removing the integration
- Delete
netlify/edge-functions/searchable.tsfrom your repo and push - Netlify → Site settings → Environment variables → remove
SEARCHABLE_TOKEN - Searchable → Agent Analytics → Setup → Tokens → revoke the token
Next steps
See the data
Open Agent Analytics to see which assistants are crawling your site.
Add Search Console
Correlate AI crawls with search demand.