Overview
Signs up a user using an OTP verification token.
- This function signs up a user using the verification token received after OTP verification (from email or SMS).
- Creates a new sub-organization for the user with the provided parameters and associates the contact (email or phone) with the sub-organization.
- Automatically generates a new API key pair for authentication and session management.
- Stores the resulting session token under the specified session key, or the default session key if not provided.
- Handles both email and SMS OTP types, and supports additional sub-organization creation parameters.
Package: core
Defined in: clients/core.ts:1397
Parameters
params
SignUpWithOtpParams
required
contact information for the user (e.g., email address or phone number).
params.createSubOrgParams
parameters for creating a sub-organization (e.g., authenticators, user metadata).
Show createSubOrgParams details
params.createSubOrgParams.apiKeys
params.createSubOrgParams.authenticators
params.createSubOrgParams.customWallet
custom wallets to create during sub-org creation time
Show customWallet details
params.createSubOrgParams.customWallet.walletAccounts
v1WalletAccountParams[]
requiredlist of wallet accounts to create
params.createSubOrgParams.customWallet.walletName
name of the wallet created
params.createSubOrgParams.oauthProviders
params.createSubOrgParams.subOrgName
name of the sub-organization
params.createSubOrgParams.userEmail
params.createSubOrgParams.userName
params.createSubOrgParams.userPhoneNumber
params.createSubOrgParams.userTag
params.createSubOrgParams.verificationToken
verification token if email or phone number is provided
params.invalidateExisting
flag to invalidate existing session for the user.
type of OTP being used (OtpType.Email or OtpType.Sms).
session key to use for session creation (defaults to the default session key).
verification token received after OTP verification.
Response
A successful response returns the following fields:
A promise that resolves to a BaseAuthResult, which includes:
sessionToken
: the signed JWT session token.