1. Enable Phone Number sign-in for your Firebase project

To sign in users by SMS, you must first enable the Phone Number sign-in method for your Firebase project:

  1. In the Firebase console, open the Authentication section.
  2. On the Sign-in Method page, enable the Phone Number sign-in method.

Firebase's phone number sign-in request quota is high enough that most apps won't be affected. However, if you need to sign in a very high volume of users with phone authentication, you might need to upgrade your pricing plan. See the pricing page.

2. Get the API key

To get an API key:

  1. Visit the Google Cloud Platform Console.
  2. Click the project drop-down and select or create the project for which you want to add an API key.
  3. Click the menu button and select APIs & Services > Credentials.
  4. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key.
  5. Click Close. The new API key is listed on the Credentials page under API keys.

3. Add api key to wp-config.php

Open file wp-config.php and add this config, don't forget change xxxxxxxxxxx with your content. This file is located in the root of your WordPress file directory and contains your website’s base configuration details, such as database connection information.

define('MBD_FIREBASE_SERVER_KEY', 'xxxxxxxxxxx');