SDK

One SDK inside other companies' apps

Why Hubble's SDK is one hosted gift card store: it runs in partner apps on five platforms, looks like each app and improves without their releases.

Partners put Hubble’s gift card store inside their own apps. We do not control those apps, their platforms, their design or when they release. This post is about why we built one hosted store that runs inside all of them, and what that choice costs.

The problem

A partner wants its users to buy gift cards from 500+ brands without leaving its app. That store is large, from search to checkout to support, and we did not want to build it five times. Each partner’s app brings its own rules:

  • Its platform. Partners ship websites, native Android and iOS apps, React Native apps and Flutter apps.
  • Its release train. A partner ships when it chooses, and its users update when they choose.
  • Its users. They are already signed in to the partner’s app, and should not have to sign in again.
  • Its look. The store has to feel like part of the partner’s app, not a page from another company.
  • Its phone. Paying by UPI means handing off to another app, and only the phone’s operating system can do that.

Why we host the store

An earlier version of our SDK built the store into a module that partners added to their own Android, iOS or React Native apps. A module inside someone else’s app changes only when they ship a release, and then only for users who update. Every fix we made waited on another company’s calendar.

So the SDK we document today works the other way round. The store is one web app that we host, and a partner opens it inside its own app. The public platform guides show the setup on each of the five platforms.

What stays with the partner

We drew the line at what only the partner’s app can do. Everything else is ours, built once.

Part Built by Why there
Screens, search, checkout, orders, coins Hubble, once The same on every platform
Each partner’s look and layout Hubble, as settings Changes without a partner release
Showing and closing the store, back navigation The partner It belongs to the partner’s app
Opening UPI apps and bank pages The partner, through the phone Only the operating system can open another app
Who the user is The partner It already knows

The partner’s part is short: open the store, pass payment links to the phone, and listen for a few messages, the most important being that the user wants to close the store. Users already signed in to the partner’s app go straight in. The SSO setup page covers the partner’s side.

Looking like the partner

Theming works in layers, and each one is used only when the one before it is not enough. Every screen is built from shared parts that ask for a role, such as “primary background”, never a raw colour, so a partner’s brand colour is one value that reaches every button. On top of that, a partner sets its colours, fonts and logo in Hubble Studio, and can choose how its home page is laid out. As a last resort, a partner can have its own version of a single part, such as a header or a loader.

Partners can see the result before they build anything, in the experience centre, linked from the SDK page.

Shipping without the partner

Because the store is hosted, every user who opens it gets the current version, and looks and layout change without a deploy at all. A partner has to release only when its own part of the contract changes, so we keep that part small and treat it like a public API. The store checks what a partner’s app supports before using it, never removes something a partner may rely on, and never lets an out-of-date partner app break the store.

What it costs

  • No partner can stay behind. Every partner gets every change when it ships, and a bad change reaches all of them at once. Settings let us turn on a new look one partner at a time, but the code underneath is shared.
  • Some failures live in the partner’s code. If a partner’s app is set up wrongly, payment apps may not open, and we cannot fix that from our side, so the docs warn about it.
  • Custom parts add up. Each partner-specific part is code we carry for every partner.

What we would tell another team

  1. Keep inside the host app only what the host alone can do, and host the rest.
  2. Treat the contract with the host like a public API: check what the host supports, add to it, never take away.
  3. Theme with shared roles first, then settings, and use per-partner code last.
  4. Give the host one clear way to close your screen, and say so loudly in the docs.
  5. Decide how partners pick a version before the first one goes live. If we started again, we would build that in from the first day.

The SDK docs cover every platform, and the SDK page says what partners get. If you would like to work on problems like this, see careers at Hubble.

Questions people ask

Why is Hubble's SDK a hosted store and not a native library?

A native library ships inside the partner's app, so every fix waits for the partner's release and then for users to update. A hosted store is written once for five platforms, and every user who opens it gets the current version.

How much does a partner have to build to add the Hubble store?

Very little. The partner opens the store inside its app, hands payment links to the phone, and listens for a few messages from the store, such as when the user wants to close it. The platform guides in the developer docs show each step.

How does the store match the look of the partner's app?

The partner sets its colours, fonts and logo in Hubble Studio, and the store uses them on every screen. The change shows the next time users open the store, without a code release.

What does a partner give up with a hosted SDK?

A partner cannot stay on an older version of the store. Every partner gets each change when it ships, so the store's contract with the partner's app has to stay small and must only ever grow.

Build with us, or on us

Read the docs, or see the roles we are hiring for.