> ## 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.

# Email OTP

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

### Compatibility

Email OTP is 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 to their email address that they will input for authentication

## Usage

You can use Email OTP login by creating a project with our [CLI tool](/embedded-wallets/quickstart/overview) and picking 'Quickstart' when prompted. Alternatively, you can integrate Email OTP directly 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 `loginWithEmailOTP`. In addition to the user's email address, you can provide a boolean indicating whether or not to show a pre-built modal interface directing the user to enter their one-time passcode. When `false`, you can implement a custom UI to continue the email OTP flow.

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 [`getInfo`](/embedded-wallets/sdk/client-side/javascript#getinfo) for Web/React Native and `getMetadata` for iOS, Android, and Flutter.

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

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

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

## Resources

* [Quickstart](/embedded-wallets/quickstart/overview)
* [Email OTP Wallets on EVM chains](https://magic.link/posts/magic-evm-nextjs-guide)
* [Web API documentation](/embedded-wallets/sdk/client-side/javascript#loginwithemailotp)
* [React Native API documentation](/embedded-wallets/sdk/client-side/react-native#loginwithemailotp)
* [iOS API documentation](/embedded-wallets/sdk/client-side/ios#loginwithemailotp)
* [Android API documentation](/embedded-wallets/sdk/client-side/android#loginwithemailotp)
* [Flutter API documentation](/embedded-wallets/sdk/client-side/flutter#loginwithemailotp)
