--- title: Phone Authentication description: Sign-in with users with their phone number. next: /firestore/usage previous: /auth/social-auth --- Phone authentication allows users to sign in to Firebase using their phone as the authenticator. An SMS message is sent to the user via their phone number containing a unique code. Once the code has been authorized, the user is able to sign in to Firebase. Phone numbers that end users provide for authentication will be sent and stored by Google to improve our spam and abuse prevention across Google services, including but not limited to Firebase. Developers should ensure they have appropriate end-user consent prior to using the Firebase Authentication phone number sign-in service. > Firebase Phone Auth is not supported in all countries. Please see their [FAQs](https://firebase.google.com/support/faq/#develop) for more information. Ensure the "Phone" sign-in provider is enabled on the [Firebase Console](https://console.firebase.google.com/project/_/authentication/providers). # Sign-in The module provides a `signInWithPhoneNumber` method which accepts a phone number. Firebase sends an SMS message to the user with a code, which they must then confirm. The `signInWithPhoneNumber` method returns a confirmation method which accepts a code. Based on whether the code is correct for the device, the method rejects or resolves. The example below demonstrates how you could setup such a flow within your own application: ```jsx import React, { useState } from 'react'; import { Button, TextInput } from 'react-native'; import auth from '@react-native-firebase/auth'; function PhoneSignIn() { // If null, no SMS has been sent const [confirm, setConfirm] = useState(null); const [code, setCode] = useState(''); // Handle the button press async function signInWithPhoneNumber(phoneNumber) { const confirmation = await auth().signInWithPhoneNumber(phoneNumber); setConfirm(confirmation); } async function confirmCode() { try { await confirm.confirm(code); } catch (error) { console.log('Invalid code.'); } } if (!confirm) { return (