Skip to content

feat: headless detection + Peec-compatible request fields (0.8.0)#9

Merged
Gdewilde merged 1 commit intomainfrom
feat/headless-detection
Apr 26, 2026
Merged

feat: headless detection + Peec-compatible request fields (0.8.0)#9
Gdewilde merged 1 commit intomainfrom
feat/headless-detection

Conversation

@Gdewilde
Copy link
Copy Markdown
Contributor

Summary

  • Detect headless browsers (Playwright/Puppeteer) via missing standard headers — adds `headless_score` / `headless_likely` and a new `headless-likely` ua_category, used by `skipBrowsers` to catch UA-spoofing automation
  • Capture `method`, `country_code` (from `x-vercel-ip-country` / `cf-ipcountry` / `x-country-code`), and opt-in `client_ip` (via `captureIp: true`) so PostHog events are a strict superset of Peec.ai's crawl-insights CSV columns
  • Bumps to 0.8.0

Why bundle

Peec consumes per-request access logs and was previously only feedable via Vercel Log Drain → Axiom export. With these fields, a PostHog SQL export now maps 1:1 to Peec's 8-column CSV (only `response_status` stays unknowable from pre-response middleware).

Test plan

  • `npm test` — 106 tests pass
  • `npm run typecheck`
  • Bump consumer site to 0.8.0 and verify new properties land on `agent_visit` events in PostHog

Add fields needed for Peec.ai crawl-insights CSV exports (and useful
on their own): request method, country code from Vercel/Cloudflare/
generic geo headers, and an opt-in raw client IP. The IP is still
hashed into distinctId by default — captureIp: true emits the raw
value as a separate property.

Bumps version to 0.8.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Gdewilde Gdewilde merged commit 415573d into main Apr 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant