You can route Velt SDK events and API calls via a proxy to your own domain. This means you will have most Velt-related network calls branded to your domain.

There are two main aspects to this:

  1. Proxying the Velt SDK
  2. Proxying Velt API calls

Proxying the Velt SDK

To serve the Velt SDK via your own proxy server (e.g., nginx) instead of Velt’s servers, provide your proxy’s base URL.

  • Velt will automatically append /lib/sdk@[VERSION_NUMBER]/velt.js to your proxyDomain to determine the full URL for fetching the SDK.
    • If proxyDomain is https://cdn.yourdomain.com, the SDK will be loaded from https://cdn.yourdomain.com/lib/sdk@[VERSION_NUMBER]/velt.js.
  • Your proxy server must be configured to to forward requests from [your_proxyDomain] to https://cdn.velt.dev without any modifications to headers or any other content.
<VeltProvider 
  config={{
    proxyDomain: 'https://cdn.yourdomain.com'
  }}
></VeltProvider>

Proxying Velt API calls

To serve the Velt APIs via your own proxy server (e.g., nginx) instead of Velt’s servers, provide your proxy’s base URL.

  • If apiProxyDomain is https://api.yourdomain.com, the APIs will be loaded from https://api.yourdomain.com.
  • Your proxy server should be configured to forward requests from [your_apiProxyDomain] to https://api.velt.dev without any modifications to headers or any other content.
<VeltProvider
  config={{
      apiProxyDomain: 'https://api.yourdomain.com'
  }}
></VeltProvider>

Integrity Check

To ensure the integrity of the Velt SDK, especially when served via a proxy, Velt leverages Subresource Integrity (SRI). Subresource Integrity (SRI) is a security feature that enables browsers to verify that resources they fetch (for example, from a CDN or your proxy server) are delivered without unexpected manipulation.

  • Default: false
<VeltProvider apiKey='YOUR_API_KEY' config={{
  integrity: true,
}}>
</VeltProvider>