Skip to content

Commit 4c0864b

Browse files
authored
Merge pull request #253 from delapuente/add-extra-headers-section-in-readme
Adding headers key to options description.
2 parents fccc267 + a3a5288 commit 4c0864b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const convertedVapidKey = urlBase64ToUint8Array(vapidPublicKey);
8585

8686
registration.pushManager.subscribe({
8787
userVisibleOnly: true,
88-
applicationServerKey: convertedVapidKey
88+
applicationServerKey: convertedVapidKey
8989
});
9090
```
9191

@@ -129,7 +129,10 @@ const options = {
129129
publicKey: '< URL Safe Base64 Encoded Public Key >',
130130
privateKey: '< URL Safe Base64 Encoded Private Key >'
131131
},
132-
TTL: <Number>
132+
TTL: <Number>,
133+
headers: {
134+
'< header name >': '< header value >'
135+
}
133136
}
134137

135138
webpush.sendNotification(
@@ -175,6 +178,7 @@ request only. This overrides any API key set via `setGCMAPIKey()`.
175178
*privateKey* values defined. These values should follow the [VAPID Spec](https://tools.ietf.org/html/draft-thomson-webpush-vapid).
176179
- **TTL** is a value in seconds that describes how long a push message is
177180
retained by the push service (by default, four weeks);
181+
- **headers** is an object with all the extra headers you want to add to the request.
178182

179183
### Returns
180184

0 commit comments

Comments
 (0)