Skip to content

SDK

The Percents SDK lets an issuer add branded rewards experiences to an existing web app without rebuilding offer, wallet, and reward activity UI.

Architecture

The integration has four pieces:

  1. The issuer host app loads @percents/web-sdk and calls Percents.init(...).
  2. The SDK requests a short-lived SDK session from the issuer-owned session endpoint.
  3. The SDK mounts the Percents iframe app and sends the session, appearance, and initial view through postMessage.
  4. The iframe calls the issuer-owned proxy API, which forwards CHG-scoped requests to Percents.

The browser never receives a broad Percents API token. It only receives an opaque proxy session token that is meaningful to the issuer proxy.

Components

The current SDK supports:

  • Offers: available branded rewards offers and merchant activation.
  • Wallet: merchant-scoped branded balance summaries and balance detail.
  • History: branded rewards activity and balance trends.

Use the SDK Playground to customize the appearance and see the SDK event stream.