Function init

  • Initializes the Kushki payment gateway with the provided options.

    Parameters

    • options: KushkiOptions

      The options for initializing the Kushki payment gateway.

    Returns Promise<IKushki>

    A Promise that resolves to an instance of the initialized Kushki payment gateway.

    Throws

    Throws an error if the initialization fails due to invalid options, network issues or public credential id undefined.

    Example

    import { IKushki, init, KushkiError } from "@kushki/js-sdk";

    const kushkiOptions : KushkiOptions = {
    publicCredentialId: '<public-credential-id>', // This corresponds to the public credential of the merchant
    inTest: true
    };

    const buildKushkiInstance = async () => {
    try {
    const kushkiInstance : Ikushki = await init(kushkiOptions);
    } catch (e: KushkiError) {
    console.error(e.message);
    }
    }

Generated using TypeDoc