Skip to content

Configure CSP and intake endpoints

For SDK 2.3.2, add these origins to your existing Content Security Policy directives:

script-src 'self' https://cdn.siteqwality.com;
connect-src 'self' https://in.siteqwality.com https://in-replay.siteqwality.com https://cdn.siteqwality.com;

Merge this fragment into your policy rather than replacing it. Authorize the inline install snippet with your nonce or a matching hash, or put the bootstrap in an allowed external script: a host allowlist does not authorize inline scripts. The CDN belongs in both directives.

HostDirectiveUsed for
https://cdn.siteqwality.comscript-src, connect-srcThe SDK core and its lazy chunks; the config at /rum/config/v2/<applicationId>.json
https://in.siteqwality.comconnect-srcEvent batches (POST /v2/batch) and identity checks (/v2/identity)
https://in-replay.siteqwality.comconnect-srcReplay segments (POST /v2/segments)

Set ingestBase, replayBase and configBase to your proxy’s host bases. Forward:

  • Event POST /v2/batch to in.siteqwality.com. Forward identity checks too: SDK 2.3.2 sends GET /v2/identity?h=<hash>, and the intake also accepts POST /v2/identity with a JSON body. Preserve Authorization, Content-Type, the body and the private/no-store response; suppress identity query strings in proxy access logs.
  • Config GET /rum/config/v2/<applicationId>.json to cdn.siteqwality.com, without adding a token.
  • Replay POST /v2/segments to in-replay.siteqwality.com, preserving Authorization, Content-Type, Origin and x-sq-replay-index, and the original gzip or JSON body.

For the fixed-URL replay transport, the index is a query-string-encoded header value, not URL parameters. Keep Authorization: Bearer <clientToken> in its header; never move tokens to query strings, path components or access logs. Preserve the response status and Retry-After, and do not turn an intake refusal into a success response.

A cross-origin replay proxy or intake must answer preflight with POST allowed and authorization, content-type, x-sq-replay-index allowed as request headers, and expose Retry-After to the browser. The intended preflight cache lifetime is 7,200 seconds; browsers may impose a lower cap.

Terminal window
curl -i -X OPTIONS https://in-replay.siteqwality.com/v2/segments \
-H 'Origin: https://YOUR_SITE.example' \
-H 'Access-Control-Request-Method: POST' \
-H 'Access-Control-Request-Headers: authorization,content-type,x-sq-replay-index'

Check the response permits all three headers and your origin. This proves only the preflight. In the browser, verify that the config GET succeeds and that the event and replay POSTs reach the correct hosts without CSP or CORS errors. A replay 403 can mean replay is not enabled for your application, an origin is refused or the token is invalid.