> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magic.link/llms.txt
> Use this file to discover all available pages before exploring further.

# SMS

> With Magic, you can use SMS one-time codes as an authentication mechanism, giving users a simple way to log in using their phones.

### Compatibility

<Note>
  **NOTE**

  See our [FAQs](/home/faq#is-my-country-code-supported) on supported country codes.
</Note>

SMS Login SDK methods are available on all [client-side SDKs](/embedded-wallets/sdk/overview#client-side-sdk).

## Use Cases

* Log in and create wallets for end users with a one-time code sent by SMS to their phone number.

## Usage

You can use SMS login by creating a project with our [CLI tool](/embedded-wallets/quickstart/overview) and picking 'SMS' when prompted. Alternatively, you can directly integrate it into your existing projects using the sample below. **Refer to the** [**API documentation**](/embedded-wallets/sdk/overview) **for information on how to install and initialize Magic for your existing project.**

Once you've created a Magic instance, log users in using `loginWithSMS`. Once logged in, you will receive a DID token that can be used with our [Admin SDK](/embedded-wallets/sdk/server-side/node#token-module) to verify the user's information and wallet address on the backend. You can also retrieve the user's wallet address and email using the `user` module's [`getInfo`](/embedded-wallets/sdk/client-side/javascript#getinfo) function for Web/React Native and `getMetadata` for iOS, Android and Flutter.

```javascript JavaScript icon="square-js" theme={null}
const login = async (phoneNumber) => {
     try {
        const did = await magic.auth.loginWithSMS({
          phoneNumber: phoneNumber,
        });
        console.log(`DID Token: ${did}`);

        const userInfo = await magic.user.getInfo();
        console.log(`UserInfo: ${userInfo}`);

⁠        // Handle user information as needed
     } catch {
       // Handle errors as required
     }
}
```

## Resources

* [Web API documentation](/embedded-wallets/sdk/client-side/javascript#loginwithsms)
* [React Native API documentation](/embedded-wallets/sdk/client-side/react-native#loginwithsms)
* [iOS API documentation](/embedded-wallets/sdk/client-side/ios#loginwithsms)
* [Android API documentation](/embedded-wallets/sdk/client-side/android#loginwithsms)
* [Flutter API documentation](/embedded-wallets/sdk/client-side/flutter#loginwithsms)
