You can call the specific login or signup methods you want to support. For example, with passkeys:
Copy
Ask AI
// Log in with a passkeyconst session = await turnkeyClient.loginWithPasskey();// Or sign up with a passkeyconst session = await turnkeyClient.signUpWithPasskey();
Here’s an example using email OTP:
Copy
Ask AI
// Log in with email OTPimport { OtpType } from "@turnkey/core";cosnt otpId = await turnkeyClient.initOtp({ otpType: OtpType.Email, contact: "email@example.com" })const session = await turnkeyClient.completeOtp({ otpId, otpCode: 123456, // The code the user received via email or SMS contact: "email@example.com", otpType: OtpType.Email, });
Sessions will be automatically created and stored in the browser’s local storage or mobile async storage on React Native.