Para supports phone number authentication, allowing users to verify their identity using SMS verification codes. This guide demonstrates how to implement a custom phone authentication flow with your own UI components.
First, determine if the user already exists in your system:
Copy
Ask AI
const checkUserExists = async (phoneNumber: string) => { const isExistingUser = await para.checkIfUserExists({ phoneNumber }); if (isExistingUser) { // Proceed with login flow for existing user } else { // Proceed with signup flow for new user }};
const registerNewUser = async (phoneNumber: string) => { // Create new user with provided phone number await para.createUser({ phoneNumber }); // SMS verification code will be sent // Proceed to verification step};