-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
34 lines (31 loc) · 815 Bytes
/
test.js
File metadata and controls
34 lines (31 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
const { Push } = require("./lib/push");
const pushClient = new Push(process.env.API_KEY || "api_key");
const test = async () => {
try {
console.log("Legen... wait for it");
const result = await pushClient.notify("Testing", "taddaaaaaaaaa 🎉");
console.log("dary!!!");
console.log("result", result);
} catch (e) {
// handle error
console.error("error", e.message);
}
};
const testWithLink = async () => {
try {
console.log("Legen... wait for it");
const result = await pushClient.notify(
"Testing",
"taddaaaaaaaaa 🎉",
"https://www.npmjs.com/package/push-sdk"
);
console.log("dary!!!");
console.log("result", result);
} catch (e) {
// handle error
console.error("error", e.message);
}
};
// let it rip!
test();
testWithLink();