NodeJS SMS OTP API for User Verification

Unveiling Phone.Email's SMS OTP API for NodeJS

Phone email Admin
Phone Email App

14 February 2024 8 mins read

In the dynamic world of user authentication, Phone.Email emerges as a game-changer with its innovative "Log in with phone" button solution. This groundbreaking feature empowers users to verify their phone numbers at little to no cost, delivering a seamless and secure user experience. Similar to Firebase phone authentication, the "Login with Phone" button is embedded in client websites, triggering a verification window that requests users to input their country code and mobile number. Once the SMS OTP is successfully verified, control is seamlessly redirected to the client website, complete with a JWT auth token.

SMS OTP API for NodeJS, Free SMS OTP Service, OTP API, Phone Verification, SMS OTP API, Login with Phone, Sign in with Phone, OTP API Node JS

Key Features of Using Phone.Email's SMS OTP API

  1. Cost-Effective Phone Verification: Phone.Email's SMS OTP API offers a cost-effective solution for phone number verification, eliminating the need for expensive third-party services.
  2. Seamless User Experience: The "Login with Phone" button ensures a smooth and user-friendly experience, allowing users to verify their phone numbers with minimal effort.
  3. Free SMS OTP Service: Enjoy the benefits of a free SMS OTP service, making it an attractive option for businesses looking to enhance security without incurring additional costs.
  4. JWT Auth Token Integration: Upon successful verification, the API seamlessly integrates with client websites, providing a JWT auth token for secure and efficient user authentication.

Integrating the "Login with Phone" Button: A Step-by-Step Guide

To harness the power of Phone.Email's SMS OTP API for NodeJS, follow these integration steps:

  1. Create an Admin Account: Begin by creating an admin account on the Phone.Email dashboard: Admin Dashboard.
  2. Add "Login with Phone" Button: Embed the "Login with Phone" button in your client website to trigger the SMS OTP verification process. Utilize the following Node.js code example:

      function openSignInWindow() {
        const COUNTRY_CODE = 'your_country_code';
        const PHONE_NO = 'your_phone_number';
        const REDIRECT_URL = 'your_redirect_url';
        const url = `https://www.phone.email/auth/sign-in?countrycode=${COUNTRY_CODE}&phone_no=${PHONE_NO}&redirect_url=${REDIRECT_URL}`;
        window.open(url, 'peLoginWindow', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0, width=500, height=560, top=' + (screen.height - 600) / 2 + ', left=' + (screen.width - 500) / 2);

    GitHub Code Snippet: Sign-in-with-Phone-NodeJS

  3. Retrieve Verified Phone Numbers in NodeJS: After successful verification, obtain verified phone numbers in Node.js using the provided code snippet:

    try {
        const decoded = jwt.verify(token, api_key, { algorithm: 'HS256' });
        jwt_response = 1; // JWT decoded successfully
        jwt_phone = decoded.country_code + decoded.phone_no;
      } catch (error) {
        jwt_response = 0; // Invalid JWT
        jwt_phone = '';

    GitHub Code Snippet: Sign-in-with-Phone-NodeJS

Explore Phone.Email's SMS OTP API in Action

To witness the power of Phone.Email's SMS OTP API and the "Login with Phone" button in action, explore our demo:

OTP API Demo using "Log in with Phone" button: Phone.Email Demo

For detailed integration guidelines and comprehensive documentation, refer to our official documentation:

Read Documentation: Phone.Email Documentation

Try it today

Get Started

Discover our offerings through the Admin Dashboard for a comprehensive exploration of our products and services.

Related Posts

Phone email Admin

Sending and Receiving Emails via Phone Numbers

In today's digital age, communication has evolved significantly. From the traditional methods of sending letters and making phone calls, we have moved on to emails, instant messaging apps, and social media. However, one aspect of communication has remained relatively unchanged: the need for email addresses. But what if there was a way to send and receive emails using just a phone number? Enter the Phone Email App, a groundbreaking solution that's changing the way we think about email communication.

22 September 2023 3 mins read
Phone email Admin

Send free OTP to verify phone number

Phone Email's OTP Verification is a powerful tool that can help businesses bolster their security, reduce bounce rates, build user trust, and optimize the user experience. Prioritizing data security and simplifying OTP delivery, Phone Email is the go-to solution for businesses seeking success in the digital world, where trust, efficiency, and customer satisfaction reign supreme.

22 September 2023 3 mins read
Phone email Admin

Revolutionizing Email: Say Goodbye to complex email addresses with...

In today's digital age, email communication has become an integral part of our personal and professional lives. However, the complexity and limitations of traditional email addresses can often be a source of frustration. But fear not! Phone.Email, a cutting-edge email provider, is here to revolutionize the way we send and receive emails. With its Android app and innovative features, Phone.Email simplifies email communication by allowing users to send emails using phone numbers instead of complex email IDs. Let's delve deeper into the benefits of Phone.Email and how it is reshaping the world of email.

22 September 2023 3 mins read