instrument-reverse-proxy
БесплатноБез исполняемых скриптовНе проверенRoute PostHog's browser traffic through the app's own domain, so ad blockers don't drop events, session replays, and feature flag calls. Use when the user…
от PostHog★ 81 звезда на GitHubОб этом скилле
Set up a PostHog reverse proxy
Use this skill to route the PostHog browser SDK's traffic through a domain the app owns. Ad blockers keep lists of analytics domains and block requests to them. Through a proxy, events, session replay data, feature flag calls, surveys, and the SDK's own scripts load from the app's domain, so ad blockers don't drop them.
A proxy is optional, and setting one up can take several steps the user has to do themselves, such as a DNS record. Set one up only when the user asked for it or agreed to your suggestion.
This skill covers the browser SDK: posthog-js and the snippet. Server-side SDKs don't need a proxy, so don't add one for them.
There are two ways to do it:
- A self-hosted proxy. A rewrite, edge function, or server route in the app's own hosting forwards a path, such as
/e, to PostHog. On platforms with built-in rewrites or edge functions, it's a few lines of configuration. - PostHog's managed reverse proxy. The user adds one DNS record for a subdomain, such as
e.example.com, and PostHog runs the proxy, its TLS certificate, and its routing. It's free on PostHog Cloud, and no proxy code goes into the app.
Trade-offs
| Self-hosted proxy | Managed proxy | |
|---|---|---|
| Setup | Code or config in the app, deployed with it. No DNS change. | One CNAME record. Needs DNS access and an organization admin. |
| Blocking | A path on the app's own domain has no CNAME, so DNS-level blockers (NextDNS, Pi-hole) can't trace it back to PostHog. | DNS-level blockers that uncloak CNAMEs can see the record points at PostHog. Browser extensions can't. |
| Cost | Requests count against the platform's bandwidth and invocation quotas. Vercel, Netlify, CloudFront, and Railway bill for them, which adds up on high-traffic sites. | Free. Doesn't touch the app's hosting quotas. |
| Maintenance | The app owns it: routing, headers, body size limits. PostHog support can't troubleshoot it. | PostHog maintains it and offers a proxy-diagnose check. |
| Compliance | Runs wherever the app runs. Works for HIPAA and EU-only edge requirements. | Runs on Cloudflare, a PostHog subprocessor. Not HIPAA-compliant, and EU edge termination isn't guaranteed. |
| Availability | Any PostHog, including self-hosted. | PostHog Cloud only. An organization gets a limited number of proxies (proxy-list returns the limit). |
Reference files
references/proxy-reference.md- Self-hosted proxy referencereferences/cloudflare.md- Cloudflare reverse proxyreferences/vercel.md- Vercel reverse proxyreferences/nextjs.md- Next.js rewrites reverse proxyreferences/nextjs-middleware.md- Next.js proxy file reverse proxyreferences/netlify.md- Netlify reverse proxyreferences/nuxt.md- Nuxt reverse proxyreferences/sveltekit.md- Sveltekit reverse proxyreferences/remix.md- Remix reverse proxyreferences/node.md- Node reverse proxyreferences/railway.md- Railway reverse proxyreferences/nginx.md- Nginx reverse proxyreferences/caddy.md- Caddy reverse proxyreferences/cloudfront.md- Aws cloudfront reverse proxyreferences/kubernetes-ingress-controller.md- Kubernetes reverse proxyreferences/pomerium.md- Pomerium reverse proxyreferences/proxy.md- Deploy a reverse proxyreferences/COMMANDMENTS.md- Framework-specific rules the integration must follow
The overview reference covers the managed proxy: its steps, troubleshooting, and FAQ. Each platform reference shows a self-hosted proxy for one platform. When this page and a reference disagree on a platform's configuration, follow the reference.
API tools
The managed proxy steps use PostHog API tools. The same tool names work through the PostHog MCP server (its exec tool) and through the hog CLI (hog api call <tool> '<json input>').
proxy-list: the organization's proxies, with their status, and the most the plan allows.proxy-create: creates a proxy for a domain. Returns itsidand thetarget_cnamefor the DNS record.proxy-get: one proxy's status and message.proxy-diagnose: checks DNS, CAA records, the certificate, and a live event, and says how to fix each failure.proxy-retry: starts provisioning again after the user fixed the problem.
Proxies belong to the organization, not the project, and only organization admins can create, retry, diagnose, or delete them. The token needs the organization:write scope. With the hog CLI, run hog auth add organization:write and ask the user to approve it in the browser. If PostHog rejects the call because the user isn't an admin, give the steps to an admin, or use a self-hosted proxy instead.
Instructions
Follow these steps IN ORDER:
STEP 1: Check what the app already has.
- Find where the app initializes posthog-js and read its
api_hostandui_host. Check the env files and the hosting configuration that set them too. - If
api_hostalready points at a domain or a path of the app, a
Установить instrument-reverse-proxy в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл instrument-reverse-proxy?
Route PostHog's browser traffic through the app's own domain, so ad blockers don't drop events, session replays, and feature flag calls. Use when the user asks for a reverse proxy or agrees to one you suggested, for example after adding posthog-js or when events or recordings seem to be missing. Don't set one up unprompted. Prefers a self-hosted proxy where the app's platform makes it a small change, such as Next.js or Cloudflare, and PostHog's managed reverse proxy elsewhere.
Как установить скилл instrument-reverse-proxy?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл instrument-reverse-proxy запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic