supertokens-node
    Preparing search index...

    Type Alias APIInterface

    type APIInterface = {
        consumeCodePOST?: (
            input: (
                | {
                    deviceId: string;
                    preAuthSessionId: string;
                    userInputCode: string;
                }
                | { linkCode: string; preAuthSessionId: string }
            ) & {
                options: APIOptions;
                session: SessionContainer | undefined;
                shouldTryLinkingWithSessionUser: boolean | undefined;
                tenantId: string;
                userContext: UserContext;
            },
        ) => Promise<
            | {
                createdNewRecipeUser: boolean;
                session: SessionContainer;
                status: "OK";
                user: User;
            }
            | {
                failedCodeInputAttemptCount: number;
                maximumCodeInputAttempts: number;
                status: | "INCORRECT_USER_INPUT_CODE_ERROR"
                | "EXPIRED_USER_INPUT_CODE_ERROR";
            }
            | { status: "RESTART_FLOW_ERROR" }
            | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
            | GeneralErrorResponse,
        >;
        createCodePOST?: (
            input: ({ email: string } | { phoneNumber: string }) & {
                options: APIOptions;
                session: SessionContainer | undefined;
                shouldTryLinkingWithSessionUser: boolean | undefined;
                tenantId: string;
                userContext: UserContext;
            },
        ) => Promise<
            | {
                deviceId: string;
                flowType: | "USER_INPUT_CODE"
                | "MAGIC_LINK"
                | "USER_INPUT_CODE_AND_MAGIC_LINK";
                preAuthSessionId: string;
                status: "OK";
            }
            | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
            | GeneralErrorResponse,
        >;
        emailExistsGET?: (
            input: {
                email: string;
                options: APIOptions;
                tenantId: string;
                userContext: UserContext;
            },
        ) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>;
        phoneNumberExistsGET?: (
            input: {
                options: APIOptions;
                phoneNumber: string;
                tenantId: string;
                userContext: UserContext;
            },
        ) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>;
        resendCodePOST?: (
            input: { deviceId: string; preAuthSessionId: string } & {
                options: APIOptions;
                session: SessionContainer | undefined;
                shouldTryLinkingWithSessionUser: boolean | undefined;
                tenantId: string;
                userContext: UserContext;
            },
        ) => Promise<
            GeneralErrorResponse
            | { status: "RESTART_FLOW_ERROR" | "OK" },
        >;
    }
    Index

    Properties

    consumeCodePOST?: (
        input: (
            | { deviceId: string; preAuthSessionId: string; userInputCode: string }
            | { linkCode: string; preAuthSessionId: string }
        ) & {
            options: APIOptions;
            session: SessionContainer | undefined;
            shouldTryLinkingWithSessionUser: boolean | undefined;
            tenantId: string;
            userContext: UserContext;
        },
    ) => Promise<
        | {
            createdNewRecipeUser: boolean;
            session: SessionContainer;
            status: "OK";
            user: User;
        }
        | {
            failedCodeInputAttemptCount: number;
            maximumCodeInputAttempts: number;
            status: | "INCORRECT_USER_INPUT_CODE_ERROR"
            | "EXPIRED_USER_INPUT_CODE_ERROR";
        }
        | { status: "RESTART_FLOW_ERROR" }
        | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
        | GeneralErrorResponse,
    >
    createCodePOST?: (
        input: ({ email: string } | { phoneNumber: string }) & {
            options: APIOptions;
            session: SessionContainer | undefined;
            shouldTryLinkingWithSessionUser: boolean | undefined;
            tenantId: string;
            userContext: UserContext;
        },
    ) => Promise<
        | {
            deviceId: string;
            flowType: | "USER_INPUT_CODE"
            | "MAGIC_LINK"
            | "USER_INPUT_CODE_AND_MAGIC_LINK";
            preAuthSessionId: string;
            status: "OK";
        }
        | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
        | GeneralErrorResponse,
    >
    emailExistsGET?: (
        input: {
            email: string;
            options: APIOptions;
            tenantId: string;
            userContext: UserContext;
        },
    ) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>
    phoneNumberExistsGET?: (
        input: {
            options: APIOptions;
            phoneNumber: string;
            tenantId: string;
            userContext: UserContext;
        },
    ) => Promise<{ exists: boolean; status: "OK" } | GeneralErrorResponse>
    resendCodePOST?: (
        input: { deviceId: string; preAuthSessionId: string } & {
            options: APIOptions;
            session: SessionContainer | undefined;
            shouldTryLinkingWithSessionUser: boolean | undefined;
            tenantId: string;
            userContext: UserContext;
        },
    ) => Promise<GeneralErrorResponse | { status: "RESTART_FLOW_ERROR" | "OK" }>