Skip to content
Esc
navigateopen⌘Jpreview
Dashboard
On this page

supertokens-node/recipe/passwordless

References documentation for the supertokens-node/recipe/passwordless package

Classes

default

Defined in: recipe/passwordless/index.ts

Constructors

Constructor
new default(): default;
Returns

default

Properties

Property Modifier Type Default value Defined in
Error static typeof default SuperTokensError recipe/passwordless/index.ts
init static (config) => RecipeListFunction Recipe.init recipe/passwordless/index.ts

Methods

checkCode()
static checkCode(input): Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  status: "OK";
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}>;

Defined in: recipe/passwordless/index.ts

This function will only verify the code (not consume it), and: NOT create a new user if it doesn’t exist NOT verify the user email if it exists NOT do any linking NOT delete the code unless it returned RESTART_FLOW_ERROR

Parameters
Parameter Type
input | { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; userInputCode: string; } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; status: "OK"; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>

consumeCode()
Call Signature
static consumeCode(input): Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}>;

Defined in: recipe/passwordless/index.ts

  1. verifies the code
  2. creates the user if it doesn’t exist
  3. tries to link it
  4. marks the email as verified
Parameters
Parameter Type
input | { deviceId: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any>; userInputCode: string; } | { linkCode: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>

Call Signature
static consumeCode(input): Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}
  | {
  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";
}>;

Defined in: recipe/passwordless/index.ts

  1. verifies the code
  2. creates the user if it doesn’t exist
  3. tries to link it
  4. marks the email as verified
Parameters
Parameter Type
input | { deviceId: string; preAuthSessionId: string; session: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; userInputCode: string; } | { linkCode: string; preAuthSessionId: string; session: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; } | { 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"; }>

createCode()
static createCode(input): Promise<{
  codeId: string;
  codeLifetime: number;
  deviceId: string;
  linkCode: string;
  preAuthSessionId: string;
  status: "OK";
  timeCreated: number;
  userInputCode: string;
}>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input | { email: string; } | { phoneNumber: string; } & object
Returns

Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; }>

static createMagicLink(input): Promise<string>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input | { email: string; tenantId: string; userContext?: Record<string, any>; } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise<string>

createNewCodeForDevice()
static createNewCodeForDevice(input): Promise<
  | {
  codeId: string;
  codeLifetime: number;
  deviceId: string;
  linkCode: string;
  preAuthSessionId: string;
  status: "OK";
  timeCreated: number;
  userInputCode: string;
}
  | {
  status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR";
}>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input { deviceId: string; tenantId: string; userContext?: Record<string, any>; userInputCode?: string; }
input.deviceId string
input.tenantId string
input.userContext? Record<string, any>
input.userInputCode? string
Returns

Promise< | { codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR"; }>

listCodesByDeviceId()
static listCodesByDeviceId(input): Promise<DeviceType>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input { deviceId: string; tenantId: string; userContext?: Record<string, any>; }
input.deviceId string
input.tenantId string
input.userContext? Record<string, any>
Returns

Promise<DeviceType>

listCodesByEmail()
static listCodesByEmail(input): Promise<DeviceType[]>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input { email: string; tenantId: string; userContext?: Record<string, any>; }
input.email string
input.tenantId string
input.userContext? Record<string, any>
Returns

Promise<DeviceType[]>

listCodesByPhoneNumber()
static listCodesByPhoneNumber(input): Promise<DeviceType[]>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input { phoneNumber: string; tenantId: string; userContext?: Record<string, any>; }
input.phoneNumber string
input.tenantId string
input.userContext? Record<string, any>
Returns

Promise<DeviceType[]>

listCodesByPreAuthSessionId()
static listCodesByPreAuthSessionId(input): Promise<DeviceType>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; }
input.preAuthSessionId string
input.tenantId string
input.userContext? Record<string, any>
Returns

Promise<DeviceType>

revokeAllCodes()
static revokeAllCodes(input): Promise<{
  status: "OK";
}>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input | { email: string; tenantId: string; userContext?: Record<string, any>; } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise<{ status: "OK"; }>

revokeCode()
static revokeCode(input): Promise<{
  status: "OK";
}>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input | { codeId: string; tenantId: string; userContext?: Record<string, any>; } | { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise<{ status: "OK"; }>

sendEmail()
static sendEmail(input): Promise<void>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input TypePasswordlessEmailDeliveryInput & object
Returns

Promise<void>

sendSms()
static sendSms(input): Promise<void>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input TypePasswordlessSmsDeliveryInput & object
Returns

Promise<void>

signInUp()
static signInUp(input): Promise<{
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: string;
  user: User;
}>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input | { email: string; session?: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; } | { phoneNumber: string; session?: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User; }>

updateUser()
static updateUser(input): Promise<
  | {
  status:   | "OK"
     | "EMAIL_ALREADY_EXISTS_ERROR"
     | "UNKNOWN_USER_ID_ERROR"
     | "PHONE_NUMBER_ALREADY_EXISTS_ERROR";
}
  | {
  reason: string;
  status:   | "EMAIL_CHANGE_NOT_ALLOWED_ERROR"
     | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR";
}>;

Defined in: recipe/passwordless/index.ts

Parameters
Parameter Type
input { email?: string; phoneNumber?: string; recipeUserId: RecipeUserId; userContext?: Record<string, any>; }
input.email? string
input.phoneNumber? string
input.recipeUserId RecipeUserId
input.userContext? Record<string, any>
Returns

Promise< | { status: | "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR"; } | { reason: string; status: | "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR"; }>

Variables

checkCode()

checkCode: (input) => Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  status: "OK";
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}> = Wrapper.checkCode;

Defined in: recipe/passwordless/index.ts

This function will only verify the code (not consume it), and: NOT create a new user if it doesn’t exist NOT verify the user email if it exists NOT do any linking NOT delete the code unless it returned RESTART_FLOW_ERROR

Parameters

Parameter Type
input | { deviceId: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; userInputCode: string; } | { linkCode: string; preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; }

Returns

Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; status: "OK"; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>


consumeCode()

consumeCode: {
  (input): Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}>;
  (input): Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}
  | {
  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";
}>;
} = Wrapper.consumeCode;

Defined in: recipe/passwordless/index.ts

Call Signature

(input): Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}>;
  1. verifies the code
  2. creates the user if it doesn’t exist
  3. tries to link it
  4. marks the email as verified
Parameters
Parameter Type
input | { deviceId: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any>; userInputCode: string; } | { linkCode: string; preAuthSessionId: string; session?: undefined; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; }>

Call Signature

(input): Promise<
  | {
  consumedDevice: {
     email?: string;
     failedCodeInputAttemptCount: number;
     phoneNumber?: string;
     preAuthSessionId: string;
  };
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: "OK";
  user: User;
}
  | {
  failedCodeInputAttemptCount: number;
  maximumCodeInputAttempts: number;
  status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR";
}
  | {
  status: "RESTART_FLOW_ERROR";
}
  | {
  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";
}>;
  1. verifies the code
  2. creates the user if it doesn’t exist
  3. tries to link it
  4. marks the email as verified
Parameters
Parameter Type
input | { deviceId: string; preAuthSessionId: string; session: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; userInputCode: string; } | { linkCode: string; preAuthSessionId: string; session: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; }
Returns

Promise< | { consumedDevice: { email?: string; failedCodeInputAttemptCount: number; phoneNumber?: string; preAuthSessionId: string; }; createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: "OK"; user: User; } | { failedCodeInputAttemptCount: number; maximumCodeInputAttempts: number; status: "INCORRECT_USER_INPUT_CODE_ERROR" | "EXPIRED_USER_INPUT_CODE_ERROR"; } | { status: "RESTART_FLOW_ERROR"; } | { 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"; }>


createCode()

createCode: (input) => Promise<{
  codeId: string;
  codeLifetime: number;
  deviceId: string;
  linkCode: string;
  preAuthSessionId: string;
  status: "OK";
  timeCreated: number;
  userInputCode: string;
}> = Wrapper.createCode;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input | { email: string; } | { phoneNumber: string; } & object

Returns

Promise<{ codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; }>


createMagicLink: (input) => Promise<string> = Wrapper.createMagicLink;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input | { email: string; tenantId: string; userContext?: Record<string, any>; } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any>; }

Returns

Promise<string>


createNewCodeForDevice()

createNewCodeForDevice: (input) => Promise<
  | {
  codeId: string;
  codeLifetime: number;
  deviceId: string;
  linkCode: string;
  preAuthSessionId: string;
  status: "OK";
  timeCreated: number;
  userInputCode: string;
}
  | {
  status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR";
}> = Wrapper.createNewCodeForDevice;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input { deviceId: string; tenantId: string; userContext?: Record<string, any>; userInputCode?: string; }
input.deviceId string
input.tenantId string
input.userContext? Record<string, any>
input.userInputCode? string

Returns

Promise< | { codeId: string; codeLifetime: number; deviceId: string; linkCode: string; preAuthSessionId: string; status: "OK"; timeCreated: number; userInputCode: string; } | { status: "RESTART_FLOW_ERROR" | "USER_INPUT_CODE_ALREADY_USED_ERROR"; }>


Error

Error: typeof default = Wrapper.Error;

Defined in: recipe/passwordless/index.ts


init()

init: (config) => RecipeListFunction = Wrapper.init;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
config TypeInput

Returns

RecipeListFunction


listCodesByDeviceId()

listCodesByDeviceId: (input) => Promise<DeviceType> = Wrapper.listCodesByDeviceId;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input { deviceId: string; tenantId: string; userContext?: Record<string, any>; }
input.deviceId string
input.tenantId string
input.userContext? Record<string, any>

Returns

Promise<DeviceType>


listCodesByEmail()

listCodesByEmail: (input) => Promise<DeviceType[]> = Wrapper.listCodesByEmail;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input { email: string; tenantId: string; userContext?: Record<string, any>; }
input.email string
input.tenantId string
input.userContext? Record<string, any>

Returns

Promise<DeviceType[]>


listCodesByPhoneNumber()

listCodesByPhoneNumber: (input) => Promise<DeviceType[]> = Wrapper.listCodesByPhoneNumber;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input { phoneNumber: string; tenantId: string; userContext?: Record<string, any>; }
input.phoneNumber string
input.tenantId string
input.userContext? Record<string, any>

Returns

Promise<DeviceType[]>


listCodesByPreAuthSessionId()

listCodesByPreAuthSessionId: (input) => Promise<DeviceType> = Wrapper.listCodesByPreAuthSessionId;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; }
input.preAuthSessionId string
input.tenantId string
input.userContext? Record<string, any>

Returns

Promise<DeviceType>


revokeAllCodes()

revokeAllCodes: (input) => Promise<{
  status: "OK";
}> = Wrapper.revokeAllCodes;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input | { email: string; tenantId: string; userContext?: Record<string, any>; } | { phoneNumber: string; tenantId: string; userContext?: Record<string, any>; }

Returns

Promise<{ status: "OK"; }>


revokeCode()

revokeCode: (input) => Promise<{
  status: "OK";
}> = Wrapper.revokeCode;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input | { codeId: string; tenantId: string; userContext?: Record<string, any>; } | { preAuthSessionId: string; tenantId: string; userContext?: Record<string, any>; }

Returns

Promise<{ status: "OK"; }>


sendEmail()

sendEmail: (input) => Promise<void> = Wrapper.sendEmail;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input TypePasswordlessEmailDeliveryInput & object

Returns

Promise<void>


sendSms()

sendSms: (input) => Promise<void> = Wrapper.sendSms;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input TypePasswordlessSmsDeliveryInput & object

Returns

Promise<void>


signInUp()

signInUp: (input) => Promise<{
  createdNewRecipeUser: boolean;
  recipeUserId: RecipeUserId;
  status: string;
  user: User;
}> = Wrapper.signInUp;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input | { email: string; session?: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; } | { phoneNumber: string; session?: SessionContainerInterface; tenantId: string; userContext?: Record<string, any>; }

Returns

Promise<{ createdNewRecipeUser: boolean; recipeUserId: RecipeUserId; status: string; user: User; }>


updateUser()

updateUser: (input) => Promise<
  | {
  status:   | "OK"
     | "EMAIL_ALREADY_EXISTS_ERROR"
     | "UNKNOWN_USER_ID_ERROR"
     | "PHONE_NUMBER_ALREADY_EXISTS_ERROR";
}
  | {
  reason: string;
  status:   | "EMAIL_CHANGE_NOT_ALLOWED_ERROR"
     | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR";
}> = Wrapper.updateUser;

Defined in: recipe/passwordless/index.ts

Parameters

Parameter Type
input { email?: string; phoneNumber?: string; recipeUserId: RecipeUserId; userContext?: Record<string, any>; }
input.email? string
input.phoneNumber? string
input.recipeUserId RecipeUserId
input.userContext? Record<string, any>

Returns

Promise< | { status: | "OK" | "EMAIL_ALREADY_EXISTS_ERROR" | "UNKNOWN_USER_ID_ERROR" | "PHONE_NUMBER_ALREADY_EXISTS_ERROR"; } | { reason: string; status: | "EMAIL_CHANGE_NOT_ALLOWED_ERROR" | "PHONE_NUMBER_CHANGE_NOT_ALLOWED_ERROR"; }>

References

APIInterface

Re-exports APIInterface


APIOptions

Re-exports APIOptions


RecipeInterface

Re-exports RecipeInterface

API reference

API schema and response details