---
title: 1. Recipe init
description: Initialize authentication with ThirdParty, EmailPassword, Passwordless, and MultiFactorAuth using SuperTokens.
sidebar:
  hidden: true
  order: 1
---

:::info[Caution]
This is the legacy method of implementing MFA. It has multiple [disadvantages](../legacy-vs-new) compared to using our MFA recipe.
:::


To start, we want to initialise the [ThirdParty + EmailPassword](https://supertokens.com/docs/authentication/social/initial-setup), the [Passwordless](https://supertokens.com/docs/authentication/passwordless/initial-setup) and the MFA recipes:


```tsx
import React from "react";

import SuperTokens from "supertokens-auth-react";
import EmailPassword from "supertokens-auth-react/recipe/emailpassword";
import ThirdParty from "supertokens-auth-react/recipe/thirdparty";
import Passwordless from "supertokens-auth-react/recipe/passwordless";
import Session from "supertokens-auth-react/recipe/session";
import MultiFactorAuth from "supertokens-auth-react/recipe/multifactorauth";

SuperTokens.init({
  appInfo: {
    appName: "<YOUR_APP_NAME>",
    apiDomain: "<YOUR_API_DOMAIN>",
    websiteDomain: "<YOUR_WEBSITE_DOMAIN>",
    apiBasePath: "/auth",
    websiteBasePath: "/auth",
  },
  recipeList: [
    // first factor method
    EmailPassword.init(),
    ThirdParty.init({
      // ...
    }),
    // second factor method
    Passwordless.init({
      contactMethod: "PHONE",
    }),
    Session.init(),
    MultiFactorAuth.init({
      firstFactors: ["emailpassword", "thirdparty"],
    }),
  ],
});
```

Notice that in the `MultiFactorAuth` init, we pass in the list of `firstFactors`. This will tell SuperTokens to only show email password + third party login in the pre-built UI for the first factor, even though we have also added `Passwordless.init` in the recipe list.

In the subsequent sections, we will be seeing how to modify theses `init` calls to achieve the flow we want. On a high level, we will be:
- Rendering the Passwordless login UI on a custom path.
- Auto skipping the screen which asks the user to input their phone number if we already have it - post sign in.
- Implementing a logout button on the second factor pre-built UI screen.

:::info[Important]
In the guide, we will assume that the first factor path is `/auth`, and the second factor path is `/second-factor`.
:::
