msg91
Advanced tools
Comparing version 0.0.7 to 2.0.0
{ | ||
"name": "msg91", | ||
"version": "0.0.7", | ||
"private": false, | ||
"description": "API For MSG91 SMS Gateway. - It is not an official version of MSG91", | ||
"main": "app.js", | ||
"author": "Hiren Soni", | ||
"version": "2.0.0", | ||
"description": "Official NodeJS package for msg91 services.", | ||
"main": "./dist/index.js", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"lint": "eslint \"**\\*.ts\"" | ||
}, | ||
"files": [ | ||
"dist", | ||
"LICENSE", | ||
"README.md" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/Walkover-Web-Solution/SendSMS-node-MSG91.git" | ||
}, | ||
"keywords": ["msg91","Official msg91 node package", "Send SMS through MSG91"], | ||
"author": "MSG91", | ||
"license": "ISC", | ||
"keywords" : [ "msg91", "API", "node.js"], | ||
"repository" : "https://github.com/hirenrojasara/Msg91" | ||
"bugs": { | ||
"url": "https://github.com/Walkover-Web-Solution/SendSMS-node-MSG91/issues" | ||
}, | ||
"homepage": "https://github.com/Walkover-Web-Solution/SendSMS-node-MSG91#readme", | ||
"devDependencies": { | ||
"@types/node": "^18.11.0", | ||
"@typescript-eslint/eslint-plugin": "^5.23.0", | ||
"@typescript-eslint/parser": "^5.23.0", | ||
"eslint": "^8.15.0", | ||
"typescript": "^4.6.4" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.27.2" | ||
} | ||
} |
@@ -1,65 +0,41 @@ | ||
# Msg91 | ||
Msg91 API for node.js | ||
# MSG91 | ||
NodeJS package for msg91 services. | ||
## Initialize Msg91 | ||
```js | ||
import msg91 from "msg91"; | ||
/** | ||
*OR | ||
*const msg91 = require('msg91').default; | ||
*/ | ||
[![NPM](https://nodei.co/npm/msg91.png?downloads=true)](https://npmjs.org/package/msg91) | ||
# Msg91 Installation | ||
```javascript | ||
npm install msg91 --save | ||
msg91.initialize({authKey: "Your-Auth-Key"}); | ||
``` | ||
# Msg91 Integration | ||
## SMS Example | ||
```js | ||
let sms = msg91.getSMS(); | ||
### Send SMS | ||
```javascript | ||
var msg91 = require("msg91")("API_KEY", "SENDER_ID", "ROUTE_NO" ); | ||
// Mobile No can be a single number, list or csv string | ||
var mobileNo = "XXXXXXXXXX"; | ||
var mobileNo = [ "XXXXXXXXXX", "XXXXXXXXXX", "XXXXXXXXXX" ]; | ||
var mobileNo = "XXXXXXXXXX,XXXXXXXXXX,XXXXXXXXXX"; | ||
msg91.send(mobileNo, "MESSAGE", function(err, response){ | ||
console.log(err); | ||
console.log(response); | ||
}); | ||
// Send SMS | ||
sms.send("flowId",{'mobile':"MOBILE_NUMBER_WITH_COUNTRY_CODE","VAR1":"123"}); | ||
``` | ||
### Get Balance | ||
```javascript | ||
msg91.getBalance(function(err, msgCount){ | ||
console.log(err); | ||
console.log(msgCount); | ||
}); | ||
// Get Balance for given Route. | ||
msg91.getBalance("ROUTE_NO", function(err, msgCount){ | ||
console.log(err); | ||
console.log(msgCount); | ||
}); | ||
## OTP Example | ||
```js | ||
let otp = msg91.getOTP("otpTemplateId"); | ||
// Send OTP | ||
otp.send("MOBILE_NUMBER_WITH_COUNTRY_CODE"); | ||
// Retry OTP | ||
otp.retry("MOBILE_NUMBER_WITH_COUNTRY_CODE"); | ||
// Verify OTP | ||
otp.verify("MOBILE_NUMBER_WITH_COUNTRY_CODE","YOUR_OTP"); | ||
``` | ||
# Msg91 Constants | ||
### ROUTE_NO | ||
```javascript | ||
1 - Promotional Route | ||
4 - Transactional Route | ||
## Campaign Example | ||
```js | ||
const campaign = msg91.getCampaign(); | ||
// Get list of campaigns | ||
campaign.getAll().then(list=>console.log(list)); | ||
// Run a campaign | ||
campaign.run('slug', {data: {}}); | ||
``` | ||
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
19146
6
459
1
1
5
1
42
+ Addedaxios@^0.27.2
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@0.27.2(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedfollow-redirects@1.15.6(transitive)
+ Addedform-data@4.0.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)