Skip to content

trackkit / dispatcher/types / ProxyTransportOptions

Type Alias: ProxyTransportOptions

ProxyTransportOptions = object

Defined in: dispatcher/types.ts:30

Sends analytics to a same-origin (or explicitly allowed) proxyUrl which forwards to the real provider. This usually bypasses adblock filters that target known analytics domains or third-party scripts.

Server contract (recommended):

http
POST {proxyUrl}
Headers:
  Content-Type: application/json
  Authorization: Bearer <token>         (optional)
  X-Trackkit-Target: <provider URL>     (required)
Body: { "payload": any }

The server should validate the target against an allowlist and forward the JSON payload to that URL, returning the provider response status.

Properties

proxyUrl

proxyUrl: string

Defined in: dispatcher/types.ts:31


token?

optional token: string

Defined in: dispatcher/types.ts:32


headers?

optional headers: Record<string, string>

Defined in: dispatcher/types.ts:33


keepalive?

optional keepalive: boolean

Defined in: dispatcher/types.ts:35

If true, use fetch({ keepalive: true }) for nicer unload semantics.


allowlist?

optional allowlist: (string | RegExp)[]

Defined in: dispatcher/types.ts:37

Optional allowlist enforcement client-side (defense-in-depth).