@justgold/sdk-bridge
v1.1.9
Published
Shared bridge types and helpers for JustGold embeddable SDKs (web, React Native, Flutter)
Maintainers
Readme
@justgold/sdk-bridge
TypeScript helpers and types for custom JustGold SDK host integrations.
Most partners should use the platform packages instead:
| Platform | Package | Version |
| ------------ | ---------------------------------------------------------------------- | ------- |
| React Native | @justgold/rn-sdk | 1.1.12 |
| Web | @justgold/web-sdk | 1.1.12 |
| Flutter | justgold_sdk | 1.1.16 |
Install @justgold/sdk-bridge only if you are building your own host shell (non-React web wrapper, custom native container, etc.).
Documentation: Bridge reference · SDK contract · CHANGELOG
Installation
yarn add @justgold/sdk-bridgeUsage
import { buildInitSessionMessage, parseBridgeMessage, type SdkSessionConfig } from '@justgold/sdk-bridge';
const session: SdkSessionConfig = {
token: sessionToken,
sandbox: false,
locale: 'en',
};
iframe.contentWindow?.postMessage(buildInitSessionMessage(session), '*');
window.addEventListener('message', event => {
const msg = parseBridgeMessage(event.data);
if (msg?.type === 'CLOSE') onClose();
});Main exports
| Export | Purpose |
| ----------------------------------------- | ------------------------------------- |
| SdkSessionConfig | Host → SDK session payload |
| SdkOutboundEvent | SDK → host event types |
| AnalyticsPayload / AnalyticsEventName | UI analytics catalog (ANALYTICS) |
| buildInitSessionMessage() | Build INIT_SESSION message |
| parseBridgeMessage() | Parse incoming postMessage data |
| resolveJustGoldApiBaseUrl(sandbox) | Sandbox vs production Partner API URL |
| resolveJustGoldSdkCdnBaseUrl() | Sandbox vs production CDN base |
| fetchSdkUiUrl() / resolveSdkUiUrl() | Fetch signed CDN URL from Partner API |
Partner environments (sandbox flag)
| sandbox | Partner API | SDK CDN |
| --------- | ---------------------------------------- | -------------------------------- |
| true | https://api.stage.partner.justgold.app | https://sdk.stage.justgold.app |
| false | https://api.partner.justgold.app | https://sdk.justgold.app |
Internal dev API/CDN hosts exist for JustGold maintainer sample apps only — not the partner contract.
Support
Contact your JustGold onboarding team for integration support and sandbox credentials.
