api.stigg.io
and edge.api.stigg.io
), you can route Stigg SDK traffic through your own backend proxy.
This guide shows how to configure your frontend SDK and proxy server to forward requests to Stigg correctly.
Overview
The Stigg frontend SDK communicates with two APIs:- Core API:
https://api.stigg.io
- Edge API:
https://edge.api.stigg.io
- A backend server (proxy) that handles incoming SDK requests and forwards them to the correct Stigg endpoints.
- Configuration updates in the SDK to point to your proxy.
- Forwarding of specific headers to avoid authorization issues.
Configure the Stigg frontend SDK
To route requests through your backend proxy, configure the Stigg frontend SDK with:baseUri
: The proxy endpoint that forwards requests tohttps://api.stigg.io
.baseEdgeUri
: The proxy endpoint that forwards requests tohttps://edge.api.stigg.io
.
Requirements for the proxy server
Once the frontend SDK is configured to send traffic to your proxy, the proxy server is responsible for correctly forwarding those requests to Stigg. It must distinguish between two types of traffic: standard API requests and edge-optimized requests. Requests targeting the Core API should be forwarded from your proxy tohttps://api.stigg.io
. Similarly, any requests related to the Edge API must be forwarded to https://edge.api.stigg.io
. This typically involves exposing two distinct paths or routes on your proxy—one for each upstream destination.
In addition to routing, the proxy must preserve the full set of headers sent by the Stigg SDK. Specifically, the following headers must be included in the forwarded request without modification:
X-API-KEY
: Used to authenticate the SDK with StiggX-API-VERSION
: Specifies which API version the SDK is usingX-CUSTOMER-KEY
: Identifies the customer associated with the request