Function requestInitAntiFraud

  • Introduction

    Function to init the Sift Science service session independently.

    Parameters

    • kushkiInstance: IKushki

      The Kushki instance that was previously initialized.

    • userId: string

      The session identifier value that can be user's ID, username, email address or empty.

    Returns Promise<SiftScienceObject>

    • Returns a Promise that resolves SiftScienceObject with session info.

    Throws

    • if the merchant credential is empty or the request fails then throw ERRORS.E003
    • if the init process fails then throw ERRORS.E023

    Example

    import { init } from "@kushki/js-sdk";
    import { requestInitAntiFraud, SiftScienceObject } from "Kushki/AntiFraud";

    const onRequestInitAntiFraud = async () => {
    try {
    const kushkiInstance = await init({
    inTest: true,
    publicCredentialId: "merchantId"
    });
    const userId= "user-identification"

    const response: SiftScienceObject = await requestInitAntiFraud(
    kushkiInstance,
    userId,
    );

    // On Success, can get Sift Science session object,
    // ex. {"sessionId":"9a64960c-a1de-4878-b975-9ab1ea30e853","userId":"eda2b0b0c5f3426483a678c82cc8a5ef"}
    console.log(response);
    } catch (error: any) {
    // On Error, catch response, ex. {code:"E023", message: "Error al configurar sesión de Sift"}
    console.error(error.message);
    }
    };

Generated using TypeDoc