Initialize
You can pass in different handler functions like the onLoad, onStart, onRestart, onPassStep, onComplete or onError method to handle different events of the verification flow to the init function.
let onLoad: () => void;
Method that is being called once a verification flow is loaded. You can use this to show your own loader and then show div allpass.
let onStart: (event: {
appKey: string;
transactionId: string;
externalUserId: string;
flowId: number;
mode: 'LIVE' | 'TEST';
}) => void;
Method that is being called once a user starts the verification flow.
appKey
: API Key
transactionId
: UUID of the verification. You can use this to query our API.
externalUserId
: External user ID (user ID in your system)
flowId : Workflow ID
mode : Live or Test mode
let onRestart: (event: {
appKey: string;
transactionId: string;
externalUserId: string;
flowId: number;
mode: 'LIVE' | 'TEST';
}) => void;
Method that is being called once a user starts the verification flow, but the verification is not completed
appKey
: API Key
transactionId
: UUID of the verification. You can use this to query our API.
externalUserId
: External user ID (user ID in your system)
flowId : Workflow ID
mode : Live or Test mode
let onPassStep: (event: {
appKey: string;
transactionId: string;
stepType: string;
externalUserId: string;
flowId: number;
mode: 'LIVE' | 'TEST';
}) => void;
Method that is being called once a user pass any step of the verification flow.
stepType:
The step can be one of the following
"intro" | "biometry" | "documents" | "scan" | "diia" | "complete"
appKey
: API Key
transactionId
: UUID of the verification. You can use this to query our API.
externalUserId
: External user ID (user ID in your system)
flowId : Workflow ID
mode : Live or Test mode
let onComplete: (event: {
appKey: string;
transactionId: string;
externalUserId: string;
flowId: number;
mode: 'LIVE' | 'TEST';
}) => void;
Method that is being called once the verification is completed.
appKey
: API Key
transactionId
: UUID of the verification. You can use this to query our API.
externalUserId
: External user ID (user ID in your system)
flowId : Workflow ID
mode : Live or Test mode
let onError: (event: {
appKey: string;
transactionId: string;
error: string;
stepType?: string;
externalUserId: string;
flowId: number;
mode: 'LIVE' | 'TEST';
}) => void;
error:
The reason why the flow failed.
stepType:
The step where the error occurred, can be undefined or one of the following
"intro" | "biometry" | "documents" | "scan" | "diia" | "complete"
appKey
: API Key
transactionId
: UUID of the verification. You can use this to query our API.
externalUserId
: External user ID (user ID in your system)
flowId : Workflow ID
mode : Live or Test mode
Allpass.init({
onLoad: () => {},
onRestart: ({appKey, transactionId, externalUserId}) => {},
onStart: ({appKey, transactionId, externalUserId}) => {},
onPassStep: ({appKey, transactionId, stepType, externalUserId}) => {},
onComplete: ({appKey, transactionId, externalUserId}) => {},
onError: ({appKey, transactionId, error, stepType, externalUserId}) => {},
});
Allpass.restart();
Also it could be chaining with an init method:
Allpass
.init({onComplete: ({appKey, transactionId, externalUserId, flowId, mode}) => {}})
.start(accessToken);
Last updated