Introduction: SMS is a common method of sending short messages between cell phones, but these SMS can be sent using API in Node.js. Now there are lots of API in the market for sending SMS like Twilio, Exotel, etc to the user but the popular among them is Nexmo.
Features of NEXMO: Integrating this module in your code is very simple and efficient. Using Nexmo module users can send SMS and also use Nexmo voice APIs for sending voice calls.
- It’s easy to get started and easy to use.
- It is widely used and popular module for sending SMS.
- User can send SMS to desired mobile number fastly and efficiently.
Installation of Nexmo module:
- You can visit the link to Install nexmo module. You can install this package by using the following command.
npm install nexmo
- After installing nexmo you can check your nexmo version in command prompt using the command.
npm version nexmo
- After that, you can create a folder and add a file. For example index.js. To run this file you need to run the following command.
- Requiring module: You need to include nexmo module in your file by using these lines.
const Nexmo = require('nexmo');
- The project structure will look like this:
- Make sure you have installed nexmo using following commands:
npm install nexmo
- Run index.js file using below command:
- If error occurs, then following message will be displayed:
- Nodejs | Automatic restart NodeJs server with nodemon
- Sending bulk SMS in Node.js using Twilio
- Sending Emails Using API in Flask-Mail
- PHP | Sending mails using mail() function
- Sending Push Notifications : Progressive Web Apps
- Sending bulk emails in Node.js using SendGrid API
- Nodejs | DNS
- Nodejs | DNS | setServers()
- Nodejs | Jimp
- Web-Socket in NodeJS
- Nodejs | GM whiteThreshold() Function
- Nodejs | GM magnify() Function
- Nodejs | GM minify() Function
- Nodejs | GM write() Function
- Nodejs | GM whitePoint() Function
Steps to run the program:
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.