This guide adds the Footprint onboarding flow for KYC (Know Your Customer) and KYB (Know Your Business) to your iOS app. Install the SDK first: Installation.

Start an onboarding

  1. Create an onboarding session. Call POST /onboardings and keep the onboarding session token it returns, such as obtok_UxM6Vbvk2Rcy1gzcSuXgk3sj3L9I0pAnNH.
  2. Launch the flow. When the user taps a button, for example, call Onboarding.shared.initialize with the onboardingSessionToken and an onComplete callback.
swift
1Button(action: {
2    Onboarding.shared.initialize(
3        onboardingSessionToken: "YOUR AUTH TOKEN",
4        onComplete: { vTok in
5            print("Onboarding complete - validation token \(vTok)")
6        }
7    )
8}) {
9    Text("Launch Footprint onboarding")
10        .frame(maxWidth: .infinity)
11}

Handle the result

When the user completes the flow, onComplete receives a validationToken. Post it to your backend for further processing.

The SDK also reports cancellation and errors. Pass onCancel and onError to initialize:

swift
1Button(action: {
2    Onboarding.shared.initialize(
3        onboardingSessionToken: "YOUR AUTH TOKEN",
4        onComplete: { vTok in
5            print("Onboarding complete - validation token \(vTok)")
6        },
7        onCancel: {
8            print("User canceled the flow")
9        },
10        onError: { error in
11            print("Error occurred \(error.message)")
12        }
13    )
14}) {
15    Text("Launch Footprint onboarding")
16        .frame(maxWidth: .infinity)
17}

Customize the appearance

Pass an appearance object to initialize to change the look of the flow:

swift
1Button(action: {
2    Onboarding.shared.initialize(
3        onboardingSessionToken: "YOUR AUTH TOKEN",
4        onComplete: { vTok in
5            print("Onboarding complete - validation token \(vTok)")
6        },
7        onCancel: {
8            print("User canceled the flow")
9        },
10        onError: { error in
11            print("Error occurred \(error.message)")
12        },
13        appearance: FootprintAppearance(
14            fontSrc: nil,
15            rules: nil,
16            variables: FootprintAppearanceVariables.createAppearanceVariables(
17                borderRadius: "8px",
18                colorError: "#E33D19",
19                colorSuccess: "#315E4C",
20                buttonPrimaryBg: "#315E4C"
21            )
22        )
23    )
24}) {
25    Text("Launch Footprint onboarding")
26        .frame(maxWidth: .infinity)
27}

The customization guide lists every variable.

Available props

Variable Description
onboardingSessionToken The onboarding session token you created.
onComplete Optional. Triggered after the user completes the onboarding flow. You receive a validationToken that your backend can exchange with Footprint to see the fp_id, the login method used, and the KYC status.
onError Optional. Called when there was an unrecoverable error during the onboarding flow.
onCancel Optional. Triggered when the user abandons the flow.
appearance Optional. A FootprintAppearance object that customizes the look of your integration.
l10n Optional. The desired localization, as a FootprintL10n object. See Localization configuration.

Next steps