Skip to main content

Deep Links

Deep links allow you to open the SDK directly to a specific page instead of the default home screen. This is useful for promotional banners, push notifications, or in-app navigation that should take the user directly to a specific brand or transaction page.

To deep link, you modify the URL path of the SDK URL. Instead of the default path, you append a route path before the query parameters. The query parameters (clientId, appSecret, token) remain the same.

Default URL (opens home):

https://sdk.myhubble.money/?clientId=...&appSecret=...&token=...

Deep link to a specific brand:

https://sdk.myhubble.money/buy/{brandId}?clientId=...&appSecret=...&token=...

Supported Routes

RouteURL PathAdditional Query ParamsDescription
Home/Opens the default home page
Brand purchase/buy/{brandId}amount, coupon, skipToPayment, consumeCoinsOpens the voucher purchase page for a brand
Search/searchcategory (optional)Opens the search page or a specific category
Transactions/transactionsshowBackButtonOpens the transactions/redemption history
Transaction Detail/transactions/{transactionId}showBackButton, exitOnBackOpens a specific transaction's detail page
Coin Transactions/coin-transactionsshowBackButtonOpens the coin transactions history
Help/helpOpens the help and support page

URL Format

https://{baseUrl}/{route}?clientId={clientId}&appSecret={appSecret}&token={token}&wrap-plt={platform}

Base URLs:

  • Development: https://sdk.dev.myhubble.money
  • Production: https://sdk.myhubble.money

Brand Purchase Query Parameters

The following query parameters can be used with the brand purchase route (/buy/{brandId}):

ParameterTypeDescription
amountnumberPre-fills the purchase amount. Must be within the brand's allowed min/max range.
couponstringApplies a coupon code to the purchase.
skipToPaymentbooleanWhen true, automatically proceeds to the payment step after the page loads.
consumeCoinsbooleanWhen true, applies available coins balance towards the purchase.

Transaction Detail Query Parameters

The following query parameters can be used with the transaction detail route (/transactions/{transactionId}):

ParameterTypeDescription
showBackButtonbooleanWhen false, hides the back button. Defaults to true (unless the client is configured to hide it).
exitOnBackbooleanWhen true, clicking the back button exits the SDK (fires close event) instead of navigating back.

Here is how to construct a deep link that opens a specific brand with a pre-filled amount and coupon:

const brandId = "01GMAVS2CHXR0XP1BZSTA9A44K"; // Amazon brandId from Hubble
const deepLinkUrl = `https://vouchers.myhubble.money/sdk/gc/buy/${brandId}`
+ `?amount=500`
+ `&coupon=SAVE20`
+ `&clientId=${clientId}`
+ `&appSecret=${appSecret}`
+ `&token=${encodeURIComponent(userToken)}`;

// Load in iframe or WebView
document.getElementById("hubble-sdk").src = deepLinkUrl;

Implementation in Code

When initializing your WebView, construct the URL with the desired deeplink route:

JavaScript/TypeScript (React Native)

const baseUrl = "https://sdk.myhubble.money/";

const sourceUrl = `${baseUrl}buy/01GMAVS2CHXR0XP1BZSTA9A44K?clientId=${clientId}&appSecret=${appSecret}&token=${token}&wrap-plt=rn`;

// Use this URL to load your WebView

Kotlin (Android)

val baseUrl = if (env == "prod") "sdk.myhubble.money" else "sdk.dev.myhubble.money"

val url = "https://$baseUrl/buy/01GMAVS2CHXR0XP1BZSTA9A44K?clientId=$clientId&appSecret=$appSecret&token=$token&wrap-plt=an"

webView.loadUrl(url)

Swift (iOS)

var components = URLComponents(string: "https://sdk.myhubble.money/buy/01GMAVS2CHXR0XP1BZSTA9A44K")!
components.queryItems = [
URLQueryItem(name: "clientId", value: clientId),
URLQueryItem(name: "appSecret", value: appSecret),
URLQueryItem(name: "token", value: token),
URLQueryItem(name: "wrap-plt", value: "ios"),
]

webview.load(URLRequest(url: components.url!))

Dart (Flutter)

final baseUrl = 'https://sdk.myhubble.money/';
// dev baseUrl is https://sdk.dev.myhubble.money/

final sourceUrl = '${baseUrl}buy/01GMAVS2CHXR0XP1BZSTA9A44K?clientId=$clientId&appSecret=$appSecret&token=$token&wrap-plt=flutter';

_controller.loadRequest(Uri.parse(sourceUrl));

Getting the brandId

The brandId is a unique identifier for each brand in the Hubble catalog. This is NOT the brand name - it is an alphanumeric string like "01GMAVS2CHXR0XP1BZSTA9A44K". The Hubble team will provide you with the list of brandIds for your catalog. You can also find brandIds in the SDK events - the visit_brand_l2 event includes the productId which is the same as the brandId.

Common Deep Link Issues
  1. Using the brand name instead of brandId in the URL path. The URL must use the brandId (e.g., '01GMAVS2CHXR0XP1BZSTA9A44K'), not the brand name ('Amazon').
  2. Deep link to help page opening FAQ instead of support form. The /help route opens the help and support page, which may display FAQ content first.
  3. Post-payment redirect not working on iOS. After payment, the SDK navigates internally. If you are trying to redirect the user outside the SDK after payment, use the voucher_generation_success event to detect completion and navigate programmatically.s
  4. On web, if the SDK is opened in a new window instead of an iframe, deep links work but you cannot receive postMessage events when the user completes their purchase.