This guide covers how to integrate the Kard Rewards WebView in your mobile or web application.
Kard’s Rewards WebView provides a turnkey front-end offers experience, complete with a rewards map and intuitive offer discovery for their users. Issuers can integrate Kard’s WebView seamlessly into their existing experiences allowing them to launch and iterate on their rewards program quickly and easily.
It is designed to be embedded in:
token (required)A JWT authentication token that identifies the user and organization.
Required JWT claims:
The token is used for API authentication when the WebView makes requests to Kard services.
theme (optional)A base64url-encoded JSON string containing design token overrides for customizing the appearance. Uses RFC4648 base64url encoding which is URL-safe (uses - instead of +, _ instead of /, and omits padding). No encodeURIComponent is needed when using base64url encoding.
Structure:
These tokens are mode-dependent and can differ between light and dark themes:
All color values must be valid CSS color values (hex, rgb, hsl, oklch, named colors, etc.).
These tokens are mode-independent and apply to both light and dark themes:
labels (optional)The labels property within the theme parameter allows customization of page titles displayed in the WebView. All label properties are optional — if not specified, the default values are used.
layout (optional)The layout property within the theme parameter controls the visibility of page sections. All layout properties are optional — if not specified, the default values are used.
The Kard SDK provides methods to generate WebView tokens. The SDK is available in multiple languages:
SDK Method:
This returns a signed JWT that should be passed as the token query parameter.
WebView tokens can also be generated via REST API. Refer to the API documentation for Get WebView Token.
The WebView uses a message-passing protocol to request location data from the container application. This is required for the rewards map feature to display nearby offers.
When the WebView needs location data, it sends:
When location is successfully retrieved:
Coordinate fields:
When location cannot be retrieved:
Below is an example showing how to apply custom branding: