Turnkey home page
Search...
⌘K
Ask AI
Demo
Login
Get started
Get started
Search...
Navigation
SDK reference
signUpWithOtp()
Documentation
SDK reference
API reference
Security
Changelogs
Support
Blog
Contact us
SDK reference
Introduction
React
React Native
Flutter
Swift
TypeScript | Frontend
Overview
Getting Started
Authentication
Advanced backend authentication
Advanced API requests
Legacy (@turnkey/sdk-browser)
SDK reference
addOauthProvider()
addPasskey()
clearAllSessions()
clearSession()
clearUnusedKeyPairs()
completeOauth()
completeOtp()
connectWalletAccount()
constructor()
createApiKeyPair()
createPasskey()
createWallet()
createWalletAccounts()
deleteSubOrganization()
disconnectWalletAccount()
exportPrivateKey()
exportWallet()
exportWalletAccount()
fetchUser()
fetchWalletAccounts()
fetchWallets()
getActiveSessionKey()
getAllSessions()
getProxyAuthConfig()
getSession()
getWalletProviders()
importPrivateKey()
importWallet()
init()
initOtp()
loginOrSignupWithWallet()
loginWithOauth()
loginWithOtp()
loginWithPasskey()
loginWithWallet()
logout()
refreshSession()
removeOauthProviders()
removePasskeys()
removeUserEmail()
removeUserPhoneNumber()
setActiveSession()
signAndSendTransaction()
signMessage()
signTransaction()
signUpWithOauth()
signUpWithOtp()
signUpWithPasskey()
signUpWithWallet()
storeSession()
switchWalletProviderChain()
updateUserEmail()
updateUserName()
updateUserPhoneNumber()
verifyOtp()
switchWalletAccountChain()
fetchPrivateKeys()
TypeScript | Server
Golang
Rust
Ruby
CLI
Python
Web3 libraries
Advanced
Migration Path
SDK reference
signUpWithOtp()
Copy page
Copy page
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:
core.ts:1353
Parameters
params
object
required
Show params details
params.
contact
string
required
contact information for the user (e.g., email address or phone number).
params.
createSubOrgParams
CreateSubOrgParams
parameters for creating a sub-organization (e.g., authenticators, user metadata).
params.
invalidateExisting
boolean
flag to invalidate existing session for the user.
params.
otpType
OtpType
required
type of OTP being used (OtpType.Email or OtpType.Sms).
params.
sessionKey
string
session key to use for session creation (defaults to the default session key).
params.
verificationToken
string
required
verification token received after OTP verification.
Response
A successful response returns the following fields:
returns
BaseAuthResult
required
A promise that resolves to a BaseAuthResult, which includes:
sessionToken
: the signed JWT session token.
Was this page helpful?
Yes
No
signUpWithOauth()
signUpWithPasskey()
Assistant
Responses are generated using AI and may contain mistakes.