This package just implements the API available for semaphore.co. They don't have one for nodejs.
npm install semaphore.co-sms
- create
.env
file
SEMAPHORE_API_KEY=apikey
const Semaphore = require('semaphore.co-sms');
let SendSMS = async () => {
let obj = {
apikey: apikey, // or you can put the api key in an .env file as SEMAPHORE_API_KEY
number: '09123456789',
message: `What's up madlang people?`,
sendername: 'SEMAPHORE', // or the sendername you applied for
};
let response = await Semaphore.send(obj);
console.log(response);
};
SendSMS();