Skip to main content

Types

SdkResult

SdkResult Type
export type SdkStep =
| 'consent'
| 'phone'
| 'verificationCode'
| 'birthday'
| 'ssn4'
| 'info';

type SdkResultData = {
identityUuid: string;
redirectUrl: string | null;
birthDate: string | null;
birthDateMismatched: boolean | null;
phone: string | null;
ssn4: string | null;
ssn4Mismatched: boolean | null;
step: SdkStep;
};

type SdkResultDataNullable = Nullable<SdkResultData>;

type SdkResultUserOptedOut =
| (SdkResultDataNullable & {
type: typeof SdkResultValues.USER_OPTED_OUT;
step: 'phone';
})
| (SdkResultData & {
type: typeof SdkResultValues.USER_OPTED_OUT;
step: Exclude<SdkStep, 'phone'>;
});

type SdkResultNoCredentialsFound = {
type: typeof SdkResultValues.NO_CREDENTIALS_FOUND;
} & SdkResultData;

type SdkResultRiskScoreTooHigh = {
type: typeof SdkResultValues.RISK_SCORE_TOO_HIGH;
} & SdkResultData;

type SdkResultMaxInputsAttemptsExceeded = {
type: typeof SdkResultValues.MAX_INPUT_ATTEMPTS_EXCEEDED;
} & SdkResultData;

type SdkResultMaxVerificationCodeAttemptsExceeded = {
type: typeof SdkResultValues.MAX_VERIFICATION_CODE_ATTEMPTS_EXCEEDED;
} & SdkResultData;

type SdkResultUserSharedCredentials = {
type: typeof SdkResultValues.USER_SHARED_CREDENTIALS;
} & SdkResultData;

export type SdkResult =
| SdkResultUserOptedOut
| SdkResultNoCredentialsFound
| SdkResultRiskScoreTooHigh
| SdkResultMaxInputsAttemptsExceeded
| SdkResultMaxVerificationCodeAttemptsExceeded
| SdkResultUserSharedCredentials;

See the SdkResultValues constant.

Examples

SdkResult Example (User Shared Credentials)
{
type: 'USER_SHARED_CREDENTIALS',
identityUuid: '3cf51925-e9fa-44f3-b091-1e1c63f4cc3d',
redirectUrl: "https://verified.inc/?identityUuid=5635fbd7-e97f-4af4-9f1f-2769fa17aa88",
birthDate: "1989-08-01",
birthDateMismatched: null,
phone: "+12125550021",
ssn4: "6789",
ssn4Mismatched: null,
step: 'info'
}
SdkResult Example (User Opted Out)
{
type: 'USER_OPTED_OUT',
identityUuid: '3cf51925-e9fa-44f3-b091-1e1c63f4cc3d',
redirectUrl: "https://verified.inc/?identityUuid=5635fbd7-e97f-4af4-9f1f-2769fa17aa88",
birthDate: null,
birthDateMismatched: null,
phone: "+12125550021",
ssn4: null,
ssn4Mismatched: null,
step: 'phone'
}
SdkResult Example (No Credentials Found)
{
type: 'NO_CREDENTIALS_FOUND',
identityUuid: '3cf51925-e9fa-44f3-b091-1e1c63f4cc3d',
redirectUrl: "https://verified.inc/?identityUuid=5635fbd7-e97f-4af4-9f1f-2769fa17aa88",
birthDate: "1989-08-01",
birthDateMismatched: null,
phone: "+12125550021",
ssn4: "6789",
ssn4Mismatched: null,
step: 'ssn4'
}
SdkResult Example (Risk Score Too High)
{
type: 'RISK_SCORE_TOO_HIGH',
identityUuid: '3cf51925-e9fa-44f3-b091-1e1c63f4cc3d',
redirectUrl: "https://verified.inc/?identityUuid=5635fbd7-e97f-4af4-9f1f-2769fa17aa88",
birthDate: "1989-08-01",
birthDateMismatched: null,
phone: "+12125550021",
ssn4: "6789",
ssn4Mismatched: null,
step: 'verificationCode'
}
SdkResult Example (Max Input Attempts Exceeded)
{
type: 'MAX_INPUT_ATTEMPTS_EXCEEDED',
identityUuid: '3cf51925-e9fa-44f3-b091-1e1c63f4cc3d',
redirectUrl: "https://verified.inc/?identityUuid=5635fbd7-e97f-4af4-9f1f-2769fa17aa88",
birthDate: "1989-08-01",
birthDateMismatched: false,
phone: "+12125550021",
ssn4: "6789",
ssn4Mismatched: true,
step: 'ssn4'
}
SdkResult Example (Max OTP Attempts Exceeded)
{
type: 'MAX_VERIFICATION_CODE_ATTEMPTS_EXCEEDED',
identityUuid: '3cf51925-e9fa-44f3-b091-1e1c63f4cc3d',
redirectUrl: "https://verified.inc/?identityUuid=5635fbd7-e97f-4af4-9f1f-2769fa17aa88",
birthDate: "1989-08-01",
birthDateMismatched: null,
phone: "+12125550021",
ssn4: "6789",
ssn4Mismatched: null,
step: 'verificationCode'
}

SdkError

type SdkError = {
reason: typeof SdkErrorReasons;
};

See the SdkErrorReasons constant.

Examples

SdkError Example (Session Timeout)
{
reason: 'SESSION_TIMEOUT';
}
SdkError Example (Invalid Session Key)
{
reason: 'INVALID_SESSION_KEY';
}
SdkError Example (Share Credentials Error)
{
reason: 'SHARE_CREDENTIALS_ERROR';
}