stackverify 1.0.0 → 1.0.2
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/package.json +8 -2
- package/src/README.md +79 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stackverify",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Node.js SDK for StackVerify API (SMS, Email, WhatsApp)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -8,7 +8,13 @@
|
|
|
8
8
|
"build": "cp src/index.js dist/index.js",
|
|
9
9
|
"test": "node test/sms.test.js"
|
|
10
10
|
},
|
|
11
|
-
"keywords": [
|
|
11
|
+
"keywords": [
|
|
12
|
+
"stackverify",
|
|
13
|
+
"sms",
|
|
14
|
+
"whatsapp",
|
|
15
|
+
"email",
|
|
16
|
+
"sdk"
|
|
17
|
+
],
|
|
12
18
|
"author": "morgan miller",
|
|
13
19
|
"license": "MIT",
|
|
14
20
|
"dependencies": {
|
package/src/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# StackVerify SDK
|
|
2
|
+
|
|
3
|
+
A simple Node.js SDK to interact with the StackVerify API for sending SMS and checking message status.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install stackverify
|
|
9
|
+
```
|
|
10
|
+
# Usage
|
|
11
|
+
```
|
|
12
|
+
import StackVerify from "stackverify";
|
|
13
|
+
|
|
14
|
+
// Initialize the SDK
|
|
15
|
+
const stack = new StackVerify({ apiKey: "YOUR_API_KEY" });
|
|
16
|
+
|
|
17
|
+
// Send an SMS and check status
|
|
18
|
+
async function main() {
|
|
19
|
+
try {
|
|
20
|
+
const response = await stack.sendSMS({
|
|
21
|
+
recipients: ["+1234567890"], // array of phone numbers
|
|
22
|
+
body: "Hello! This is a test message.",
|
|
23
|
+
sender_id: "SMS"
|
|
24
|
+
});
|
|
25
|
+
console.log("SMS sent:", response);
|
|
26
|
+
|
|
27
|
+
const status = await stack.getSMSStatus(response.message_id);
|
|
28
|
+
console.log("SMS status:", status);
|
|
29
|
+
|
|
30
|
+
} catch (err) {
|
|
31
|
+
console.error("Error:", err.message);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
main();
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
# Api
|
|
39
|
+
|
|
40
|
+
new StackVerify({ apiKey, baseUrl })
|
|
41
|
+
|
|
42
|
+
apiKey (string) — Your StackVerify API key (required)
|
|
43
|
+
|
|
44
|
+
baseUrl (string) — API base URL (default: https://stackverify.site/api/v1)
|
|
45
|
+
|
|
46
|
+
sendSMS({ recipients, body, sender_id })
|
|
47
|
+
|
|
48
|
+
Send an SMS.
|
|
49
|
+
|
|
50
|
+
recipients — array of phone numbers (required)
|
|
51
|
+
|
|
52
|
+
body — SMS message text (required)
|
|
53
|
+
|
|
54
|
+
sender_id — your sender ID (required)
|
|
55
|
+
|
|
56
|
+
getSMSStatus(messageId)
|
|
57
|
+
|
|
58
|
+
Get the status of a sent message.
|
|
59
|
+
|
|
60
|
+
messageId — ID returned by sendSMS (required)
|
|
61
|
+
## Badges
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
[](https://choosealicense.com/licenses/mit/)
|
|
65
|
+
[](https://opensource.org/licenses/)
|
|
66
|
+
[](http://www.gnu.org/licenses/agpl-3.0)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
## Authors
|
|
70
|
+
|
|
71
|
+
- [@morgan miller](https://www.github.com/Frost-bit-star)
|
|
72
|
+
|
|
73
|
+
- [@samwuel simiyu](https://github.com/Trojan-254)
|
|
74
|
+
|
|
75
|
+
## 🔗 Links
|
|
76
|
+
[](https://stackverify.site/)
|
|
77
|
+
[](https://www.linkedin.com/)
|
|
78
|
+
[](https://twitter.com/)
|
|
79
|
+
|