node-webpush 1.0.5 → 1.0.6
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 +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -141,12 +141,12 @@ Constructing `WebPush` validates:
|
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
|
|
144
|
-
### `webpush.
|
|
144
|
+
### `webpush.generateRequest(subscription, payload?, options?)`
|
|
145
145
|
|
|
146
146
|
Returns the request parameters to call `fetch()` yourself.
|
|
147
147
|
|
|
148
148
|
```ts
|
|
149
|
-
const {endpoint, init} = webpush.
|
|
149
|
+
const {endpoint, init} = webpush.generateRequest(subscription, "payload", {
|
|
150
150
|
TTL: 60,
|
|
151
151
|
});
|
|
152
152
|
|
|
@@ -243,7 +243,7 @@ const webpush = new WebPush({
|
|
|
243
243
|
},
|
|
244
244
|
});
|
|
245
245
|
|
|
246
|
-
const {endpoint, init} = webpush.
|
|
246
|
+
const {endpoint, init} = webpush.generateRequest(subscription, "ping", {
|
|
247
247
|
TTL: 120,
|
|
248
248
|
urgency: "high",
|
|
249
249
|
});
|