Streamit Laravel - Documentation
Streamit Laravel

How to OTP login setup?

Steps to Retrieve Firebase Credentials for OTP Login

1.Create a Firebase Project:

  • Go to the Firebase Console.
  • Log in with your Google account.
  • Click on ‘Add Project’ or select an existing project.

2. Add an App to Your Firebase Project:

  • In the Firebase project dashboard, click on the gear icon ⚙️ in the sidebar and go to Project Settings.
  • Scroll to the Your apps section and click on the ‘Add app’ button.
  • Select your platform (e.g., Web) and register the app.

3. Retrieve the Configuration Object:

  • After registering the app, Firebase will provide you with a configuration object.
  • It will look something like this:
const firebaseConfig = {
apiKey: 'your-api-key',
authDomain: 'your-auth-domain.firebaseapp.com',
databaseURL: 'https://your-database-name.firebaseio.com',
projectId: 'your-project-id',
storageBucket: 'your-storage-bucket.appspot.com',
messagingSenderId: 'your-messaging-sender-id',
appId: 'your-app-id',
measurementId: 'your-measurement-id'
};
  • Copy this configuration and save it for your use.

4. Enable Phone Authentication:

  • Go to the Firebase Console and navigate to Build > Authentication > Sign-in method.
  • Enable Phone as a sign-in provider.

5. Set Up OTP Login:

Note:
If you want this flow to work on the web, you will need to open this link:
https://cloud.google.com/identity-platform/pricing

From the pricing table, purchase the plan that fits your requirement. Only after activating the plan will the flow start working on the web.

To enable the OTP feature, you must first create a Firebase project for the web and then purchase a plan from the link above (based on your requirement). Only after purchasing the plan will the OTP feature work.

For the mobile app, it might be working because some free limits are available. But if you purchase the plan, the OTP feature will work properly and reliably in the app as well.