supertokens-node
    Preparing search index...

    Type Alias RecipeInterface

    type RecipeInterface = {
        getProvider(
            input: {
                clientType?: string;
                tenantId: string;
                thirdPartyId: string;
                userContext: UserContext;
            },
        ): Promise<undefined | TypeProvider>;
        manuallyCreateOrUpdateUser(
            input: {
                email: string;
                isVerified: boolean;
                session: SessionContainer | undefined;
                shouldTryLinkingWithSessionUser: boolean | undefined;
                tenantId: string;
                thirdPartyId: string;
                thirdPartyUserId: string;
                userContext: UserContext;
            },
        ): Promise<
            | {
                createdNewRecipeUser: boolean;
                recipeUserId: RecipeUserId;
                status: "OK";
                user: User;
            }
            | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" }
            | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
            | {
                reason:
                    | "EMAIL_VERIFICATION_REQUIRED"
                    | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                    | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                    | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
                status: "LINKING_TO_SESSION_USER_FAILED";
            },
        >;
        signInUp(
            input: {
                email: string;
                isVerified: boolean;
                oAuthTokens: { [key: string]: any };
                rawUserInfoFromProvider: {
                    fromIdTokenPayload?: { [key: string]: any };
                    fromUserInfoAPI?: { [key: string]: any };
                };
                session: SessionContainer
                | undefined;
                shouldTryLinkingWithSessionUser: boolean | undefined;
                tenantId: string;
                thirdPartyId: string;
                thirdPartyUserId: string;
                userContext: UserContext;
            },
        ): Promise<
            | {
                createdNewRecipeUser: boolean;
                oAuthTokens: { [key: string]: any };
                rawUserInfoFromProvider: {
                    fromIdTokenPayload?: { [key: string]: any };
                    fromUserInfoAPI?: { [key: string]: any };
                };
                recipeUserId: RecipeUserId;
                status: "OK";
                user: User;
            }
            | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
            | {
                reason:
                    | "EMAIL_VERIFICATION_REQUIRED"
                    | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                    | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                    | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
                status: "LINKING_TO_SESSION_USER_FAILED";
            },
        >;
    }
    Index

    Methods

    • Parameters

      • input: {
            clientType?: string;
            tenantId: string;
            thirdPartyId: string;
            userContext: UserContext;
        }

      Returns Promise<undefined | TypeProvider>

    • Parameters

      • input: {
            email: string;
            isVerified: boolean;
            session: SessionContainer | undefined;
            shouldTryLinkingWithSessionUser: boolean | undefined;
            tenantId: string;
            thirdPartyId: string;
            thirdPartyUserId: string;
            userContext: UserContext;
        }

      Returns Promise<
          | {
              createdNewRecipeUser: boolean;
              recipeUserId: RecipeUserId;
              status: "OK";
              user: User;
          }
          | { reason: string; status: "EMAIL_CHANGE_NOT_ALLOWED_ERROR" }
          | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
          | {
              reason:
                  | "EMAIL_VERIFICATION_REQUIRED"
                  | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                  | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                  | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
              status: "LINKING_TO_SESSION_USER_FAILED";
          },
      >

    • Parameters

      • input: {
            email: string;
            isVerified: boolean;
            oAuthTokens: { [key: string]: any };
            rawUserInfoFromProvider: {
                fromIdTokenPayload?: { [key: string]: any };
                fromUserInfoAPI?: { [key: string]: any };
            };
            session: SessionContainer
            | undefined;
            shouldTryLinkingWithSessionUser: boolean | undefined;
            tenantId: string;
            thirdPartyId: string;
            thirdPartyUserId: string;
            userContext: UserContext;
        }

      Returns Promise<
          | {
              createdNewRecipeUser: boolean;
              oAuthTokens: { [key: string]: any };
              rawUserInfoFromProvider: {
                  fromIdTokenPayload?: { [key: string]: any };
                  fromUserInfoAPI?: { [key: string]: any };
              };
              recipeUserId: RecipeUserId;
              status: "OK";
              user: User;
          }
          | { reason: string; status: "SIGN_IN_UP_NOT_ALLOWED" }
          | {
              reason:
                  | "EMAIL_VERIFICATION_REQUIRED"
                  | "RECIPE_USER_ID_ALREADY_LINKED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                  | "ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR"
                  | "SESSION_USER_ACCOUNT_INFO_ALREADY_ASSOCIATED_WITH_ANOTHER_PRIMARY_USER_ID_ERROR";
              status: "LINKING_TO_SESSION_USER_FAILED";
          },
      >