unismsgateway 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -0
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
|
|
2
|
+
# Unified Sms Gateway
|
|
3
|
+
|
|
4
|
+
Most of the time a single project relies on multiple sms Gateway so it can switched if one goes off.
|
|
5
|
+
However, each sms api specification is different from the other, hence the need to create separate implementation
|
|
6
|
+
for each sms gateway.
|
|
7
|
+
|
|
8
|
+
Unified sms gateway is library that brings most common sms gateways under a Unified api.
|
|
9
|
+
which means you only does one implementation in it works for all supported sms gateway.
|
|
10
|
+
you just have select or switch your sms platform and your code still works fine like nothing has changed
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage/Examples
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
const unisms = require('unismsgateway')
|
|
17
|
+
|
|
18
|
+
const param = { clientId, // hubtel sms client Id **optional
|
|
19
|
+
clientSecret, // hubtel sms client secret ** optional
|
|
20
|
+
username, // username for route sms
|
|
21
|
+
password, // password for route sms
|
|
22
|
+
host, // host address eg. rslr.connectbind.....
|
|
23
|
+
port} // port defaults to 8080
|
|
24
|
+
|
|
25
|
+
//init with prefered platform id. route => routemobile, hubtel => hubtel sms
|
|
26
|
+
// more sms services will be added or supported in the future
|
|
27
|
+
const gateway = unisms.init({platformId:'route', param})
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### SEND MESSAGE
|
|
32
|
+
```javascript
|
|
33
|
+
|
|
34
|
+
const testSms = async function(){
|
|
35
|
+
try{
|
|
36
|
+
// const gateway = unisms.getSmsPlatform();
|
|
37
|
+
await gateway.quickSend({From:'xxxxx', To: xxxxxxxx, Content: 'Testing unisms', Type: 0}, (response)=>{
|
|
38
|
+
console.log(response)
|
|
39
|
+
}).then(r => {
|
|
40
|
+
console.log(r)
|
|
41
|
+
}).catch(err => {
|
|
42
|
+
console.log(err)
|
|
43
|
+
})
|
|
44
|
+
}catch(err){
|
|
45
|
+
console.log(err)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## supported bulk sms gateways
|
|
55
|
+
|
|
56
|
+
Hubtel bulk sms (Ghana) using hubtel-sms-extended
|
|
57
|
+
routeMobile sms (India) using routemobilesms
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## Roadmap
|
|
62
|
+
|
|
63
|
+
- Additional browser support
|
|
64
|
+
|
|
65
|
+
- Add more third party sms integrations
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## License
|
|
69
|
+
|
|
70
|
+
[MIT](https://choosealicense.com/licenses/mit/)
|
|
71
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unismsgateway",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A unified sms gateway library that brings access to multiple sms gateways under a single API",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|