-1

I am writing a backend with node js. This backend will serve both the mobile side and the web side. Now I have a task like this: I want to write an sms verification service. When a request is made to this service, whether it is from the mobile side or from the web side, it should send an OTP code to the specified phone number and verify it.

I thought that I could do this with firebase, but it didn't happen, because since Firebas itself is a BaaS, it seemed more logical to use firebase on the front side. but i want to write it a service on backend side. Also, I tried to do it with a modem (I was also sending sms with a modem and verifying), but since my service will run on servers like a VPS, I can't put a modem there. that's why this doesn't happen. If you have any ideas, please let me know.

desertnaut
  • 57,590
  • 26
  • 140
  • 166

1 Answers1

0

Firebase Authentication can only send SMS messages to the currently signed in user, and only from its client-side SDKs. Firebase does not have any built-in feature to allow you to send SMS messages from the server.

Since connecting to your own device to send the SMS is not an option as you said, the most common solution would be to use another 3rd party SMS sending service, such as Twilio or Vonage. You'd then call their API from your Node.js code to send the SMS messages with an OTP.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • You say it right, but there is an access block to the services you mentioned here. In this case, what kind of way should I follow to do this job, what can you suggest? – Rozygeldiyew May 09 '23 at 14:41
  • I cannot suggest specific services, both because I don't know and because that's off-topic on Stack Overflow. But if you tailor the search to your region, you should be able to find the options. – Frank van Puffelen May 09 '23 at 15:19
  • Thank you [link]https://stackoverflow.com/users/209103/frank-van-puffelen Frank van Puffelen – Rozygeldiyew May 10 '23 at 12:23