Summary
A Handler that runs whenever the user is still in the process of authentication, but has some missing kyc data to complete before they can be fully authenticated.
If information capture is enabled and has required fields or optional fields without the option to skip optional fields during onboarding turned on, the user must be updated with the required information before they’re considered authenticated.
This handler is always used when it’s set, which means the sdk will not display the modal to prompt for user information.
The handler must be set when using the sdk in a headless mode or if you wish to handle onboarding on your own.
Usage
<DynamicContextProvider
settings={{
handlers: {
handleUserOnboarding: async (missingFields: UserOnboardingFieldRequest[]) => {
console.log("handleUserOnboarding was called", missingFields);
* missingFields: [
* {
* key: 'email',
* required: true,
* isCustom: false,
* },
* {
* key: 'city',
* required: false,
* isCustom: true,
* label: 'City',
* }
* ]
*/
return [
{ key: 'email', value: 'email@test.com', isCustom: false },
{ key: 'city', value: 'New York', isCustom: true },
];
},
},
}}
>
{}
</DynamicContextProvider>
Types
type HandleUserOnboarding = (
missingFields: UserOnboardingFieldRequest[],
) => Promise<UserOnboardingFieldResponse[]>;
type UserOnboardingFieldRequest = {
key: string;
required: boolean;
isCustom: boolean;
label?: string;
};
type UserOnboardingFieldResponse = {
key: string;
value: string;
isCustom: boolean;
};