For the complete documentation index, see llms.txt. This page is also available as Markdown.

Event Handlers

Event Handlers for Tracking (Credit Cards, Web Wrapper)

The SDK component exposes optional event callback props that notify your app when key moments occur during the user's journey. Each callback receives an event object containing a timestamp (ISO 8601 UTC) and event-specific fields.

Usage

All callbacks are optional. Pass any combination of callbacks when constructing the SDK component. If a callback is not provided, the SDK will still log the event to the debug console in development mode.

<WebWrapper
  channel="your-channel"
  zone="your-zone"
  bearerToken="{your_token}"
  productTypes={[ApiModels.ProductType.CreditCard]}
  onInitialize={(evt) => console.log('onInitialize', evt)}
  onCreate={(evt) => console.log('onCreate', evt.leadUuid)}
  onSubmit={(evt) => console.log('onSubmit', evt.leadUuid)}
  onOfferClick={(evt) => console.log('onOfferClick', evt.offerUuid)}
  onExit={(evt) => console.log('onExit', evt)}
  // ...other callbacks
/>

Available Events

Callback
Trigger

onInitialize

SDK finished loading the embed

onCreate

New lead created

onUpdate

Lead data updated

onNavigate

Page navigation within the flow

onSubmit

Lead form submitted

onRateTableRender

Rate table displayed with offers

onOfferClick

User clicked an offer

onErrorPageView

Error page displayed in the flow

onErrorPageRetry

User retried from the error page

onExit

User exited the SDK

onEmbedError

Web embed failed to load

onEmbedErrorRetry

User retried after embed failure

Event Properties

onInitialize

Fired when the SDK finishes loading the embedded experience.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

onCreate

Fired when a new lead is created in the system.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

leadUuid

String

Unique identifier for the newly created lead

createPage

String

The page where the lead was created

editingPage

String

The page that the user is currently editing

onUpdate

Fired when lead data is updated.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

leadUuid

String

Unique identifier for the lead

updatePage

String

The page where the update occurred

editingPage

String

The page that the user is currently editing

onNavigate

Fired on page navigation within the flow.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

leadUuid

String

Unique identifier for the lead

fromPage

String

The page the user is navigating away from

toPage

String

The page the user is navigating to

editingPage

String

The page that the user is currently editing

onSubmit

Fired when the lead form is submitted for offer matching.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

leadUuid

String

Unique identifier for the submitted lead

onRateTableRender

Fired when the rate table is rendered with offers. For Credit Cards, creditCardOffers is populated.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

rateTableUuid

String

Unique identifier for the Engine rate table

creditCardOffers

List

Array of credit card offers returned for the lead

onOfferClick

Fired when the user clicks on a credit card offer.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

leadUuid

String

Unique identifier for the lead

offerUuid

String

Unique identifier for the clicked offer

financialInstitutionBrandName

String

Brand name of the card issuer

cardName

String

Name of the credit card

isITA

bool

Whether the offer is an instant-to-apply (ITA) offer

cardNetwork

String

Card network (e.g. Visa, Mastercard)

onErrorPageView

Fired when the error page is displayed within the embedded flow.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

leadUuid

String

Unique identifier for the lead

fromPage

String

The page the user was on before the error

editingPage

String

The page that the user was editing

onErrorPageRetry

Fired when the user taps "Retry" on the error page within the embedded flow.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

leadUuid

String

Unique identifier for the lead

toPage

String

The page the user is retrying to navigate to

editingPage

String

The page that the user was editing

onExit

Fired when the user exits the SDK flow (e.g., taps the close button).

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

onEmbedError

Fired when the embedded web view fails to load (network error, HTTP 4xx/5xx, etc.).

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

errorMessage

String

Description of the error that occurred

onEmbedErrorRetry

Fired when the user taps "Retry" after an embed load failure.

Field
Type
Description

timestamp

String

ISO 8601 UTC timestamp of when the event was emitted

errorMessage

String

Description of the original error that triggered the retry

Last updated

Was this helpful?