Platform Guides
Now that authentication is set up and you can generate SSO tokens for your users, it is time to embed the Hubble SDK into your application.
Understanding the SDK URL
The Hubble SDK is a hosted web application. You integrate it by loading a URL with your credentials and the user's SSO token. Here is the URL structure:
https://sdk.dev.myhubble.money/
?clientId=YOUR_CLIENT_ID
&appSecret=YOUR_APP_SECRET
&token=YOUR_SSO_TOKEN
| Parameter | Required | Description |
|---|---|---|
clientId | Required | Client ID provided by the Hubble team during onboarding |
appSecret | Required | App secret provided by the Hubble team (used for server-side config lookup) |
token | Required | SSO token for the current user |
appVersion | Optional | App version string. Defaults to "10000". |
deviceId | Optional | Device identifier for analytics tracking. |
The token parameter must be a valid SSO token generated by your backend for the current user.
Choose Your Platform
The Hubble SDK can be integrated on any platform. Choose the platform that matches your application and follow the corresponding integration guide:
| Platform | Integration Method | Guide |
|---|---|---|
| Web | iframe with postMessage events | Web Integration Guide |
| Android | WebView with JavaScript interface | Android Integration Guide |
| iOS | WKWebView with script message handler | iOS Integration Guide |
| React Native | react-native-webview with onMessage | React Native Integration Guide |
| Flutter | webview_flutter with JavaScript channel | Flutter Integration Guide |
Each platform guide covers the six integration steps in detail:
- Setup the WebView - configure the WebView or iframe with the required settings.
- Initialization - build the SDK URL with your credentials and platform parameter.
- Load the WebView - load the URL and register event handlers.
- Handling Navigation - keep Hubble and payment URLs in the WebView, open other URLs externally, and implement back navigation.
- Handling Events - listen for action events (app_ready, close, error) and analytics events.
- Payment Configuration - platform-specific UPI and card payment setup.
When integrating on iOS, you must use WKWebView. Do not use SFSafariViewController - it causes Hubble's fraud detection to fail, blocking transactions.
SDK Events Overview
The SDK communicates with your app through JavaScript messages (events). All platforms receive the same event types, but the mechanism differs. Action events control the SDK lifecycle:
| Action | When It Fires | What You Should Do |
|---|---|---|
app_ready | SDK has finished loading | Show the WebView / iframe. Hide your loading spinner. |
close | User tapped close or back button in the SDK | Dismiss the WebView / iframe. Navigate the user back. |
error | SDK failed to load | Hide the WebView. Show a user-friendly error with retry. |
The close action is the only way the SDK tells your application that the user wants to leave. If you do not handle it, the user will be stuck inside the SDK with no way to navigate back. This is the most common integration issue reported by partners.