Expand description
First-party proxies for Plausible and the Sentry browser SDK.
Both vendors’ own origins are on blocklists, and a blocked request is a visitor you never counted or an error you never saw. Serving their scripts and receiving their payloads from this origin makes the traffic same-origin, which is what Plausible themselves recommend.
Nothing here interprets a payload — see [proxy] for why that matters.
Structs§
- Analytics
Config - Which Plausible site events belong to.
- Sentry
Dsn - A parsed Sentry DSN.
- Sentry
DsnParse Error - Why a DSN could not be understood.
Constants§
- CLIENT_
IP_ HEADERS - Headers consulted for the client’s real address, most trusted first. The socket address is the fallback: always present, but behind a proxy it is the proxy.
- ENV_
ANALYTICS_ ID - The environment variable holding the Plausible script id.
- ENV_
SENTRY_ BROWSER_ DSN - The environment variable holding the browser Sentry DSN.
- PLAUSIBLE_
HOST - Plausible’s script host.
- SENTRY_
CDN_ HOST - Sentry’s loader-script CDN.
Functions§
- relay_
envelope - Relays a Sentry envelope verbatim.
- relay_
event - Forwards a Plausible event, carrying the real visitor IP.
- relay_
script - Fetches an upstream script and returns it with the upstream’s own headers.
- resolve_
true_ client_ ip_ address - Resolves the client’s address, preferring proxy headers over the socket.