trackkit / dispatcher/types / ProxyTransportOptions
Type Alias: ProxyTransportOptions
ProxyTransportOptions =
object
Defined in: dispatcher/types.ts:49
Sends analytics to a same-origin (or explicitly allowed) proxy URL which forwards to the real provider.
This usually bypasses ad blockers that target known analytics domains or third-party scripts.
Recommended server contract:
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:55
URL of the proxy endpoint to send analytics through.
Example
"/api/trackkit"token?
optionaltoken:string
Defined in: dispatcher/types.ts:60
Optional bearer token for proxy authorisation.
headers?
optionalheaders:Record<string,string|undefined>
Defined in: dispatcher/types.ts:65
Additional static headers to include in proxy requests.
keepalive?
optionalkeepalive:boolean
Defined in: dispatcher/types.ts:70
If true, use fetch({ keepalive: true }) for nicer unload semantics.
allowlist?
optionalallowlist: (string|RegExp)[]
Defined in: dispatcher/types.ts:78
Optional allowlist enforcement client-side (defence-in-depth).
When set, the proxy target URL must match at least one entry in this list or the request will be blocked by the client.