- CDN — the SDK bundle itself (
proxyConfig.cdnHost) - API — Velt API calls (
proxyConfig.apiHost) - Persistence Database — Velt persistence database (
proxyConfig.v2DbHost) - Ephemeral Database — Velt realtime database (
proxyConfig.v1DbHost) - Storage — file/attachment storage (
proxyConfig.storageHost) - Auth — authentication token endpoints (
proxyConfig.authHost)
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.jsto yourproxyConfig.cdnHostto determine the full URL for fetching the SDK.- If
proxyConfig.cdnHostishttps://cdn.yourdomain.com, the SDK will be loaded fromhttps://cdn.yourdomain.com/lib/sdk@[VERSION_NUMBER]/velt.js.
- If
- Your proxy server must be configured to to forward requests from
[your_proxyDomain]tohttps://cdn.velt.devwithout any modifications to headers or any other content.
- React / Next.js
- Other Frameworks
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 using proxyConfig.apiHost.
- Your proxy server should be configured to forward requests from your proxy host to
https://api.velt.devwithout any modifications to headers or any other content.
- React / Next.js
- Other Frameworks
Proxying Persistence Database
To route Persistence Database (Velt v2 database) traffic through your proxy, setproxyConfig.v2DbHost.
- Your proxy server should forward requests to the persistence endpoint used by your Velt project without modifying headers or content.
- React / Next.js
- Other Frameworks
Proxying Ephemeral Database
To route Ephemeral Database (Velt v1 database) traffic through your proxy, setproxyConfig.v1DbHost. This replaces the firebaseio.com domain in all RTDB URLs.
- Your proxy server should forward requests to
*.firebaseio.comwithout modifying headers or content.
When
v1DbHost is set, the SDK host-locks RTDB by overriding the Firebase
SDK’s internal host property setter. This prevents Firebase’s handshake from
redirecting traffic to a shard server (s-gke-*.firebaseio.com), keeping all
RTDB requests on your proxy domain for the lifetime of the connection.- React / Next.js
- Other Frameworks
Proxying Storage
To route File Storage (file attachments, recordings) traffic through your proxy, setproxyConfig.storageHost. This replaces firebasestorage.googleapis.com.
- Your proxy server should forward requests to
firebasestorage.googleapis.comwithout modifying headers or content.
- React / Next.js
- Other Frameworks
Proxying Auth
To route Auth traffic through your proxy, setproxyConfig.authHost. This replaces both identitytoolkit.googleapis.com and securetoken.googleapis.com.
- Your proxy server should forward requests to both
identitytoolkit.googleapis.comandsecuretoken.googleapis.combased on the request path, without modifying headers or content.
The SDK caches the auth proxy host in
localStorage during initConfig(). On
subsequent page loads, the cached value is applied synchronously before Auth
can fire an internal token refresh, ensuring the refresh request goes through
your proxy rather than directly to Google.- React / Next.js
- Other Frameworks
Full proxy configuration
To route all Velt traffic through your proxies, configure every host together. You can also setforceLongPolling: true to force persistence and ephemeral Database connections to use long-polling instead of WebSockets (useful when your proxy does not support WebSocket upgrades).
- React / Next.js
- Other Frameworks
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
- React / Next.js
- Other Frameworks

