Skip to content

Commit 808eb95

Browse files
author
Matt Gaunt
committed
Adding feedback from review
1 parent 18d1941 commit 808eb95

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ webpush.sendNotification(
121121
);
122122
```
123123

124+
> **Note:** `sendNotification()` you don't need to define a payload, and this
125+
method will work without a GCM API Key and / or VAPID keys if the push service
126+
supports it.
127+
124128
### Input
125129

126130
**Push Subscription**
@@ -133,19 +137,22 @@ in the browser.
133137

134138
**Payload**
135139

136-
The payload sent with a push message. This must be either a *string* or a
137-
node [*Buffer*](https://nodejs.org/api/buffer.html).
140+
The payload is optional, but if set, will be the data sent with a push
141+
message.
142+
143+
This must be either a *string* or a node
144+
[*Buffer*](https://nodejs.org/api/buffer.html).
138145

139146
> **Note:** In order to encrypt the *payload*, the *pushSubscription* **must**
140147
have a *keys* object with *p256dh* and *auth* values.
141148

142149
**Options**
143150

144-
Options is an optional argument that if defined hould be an object with
145-
any of the following values defined.
151+
Options is an optional argument that if defined should be an object containing
152+
any of the following values defined, although none of them are required.
146153

147-
- **gcmAPIKey** can be a GCM API key to be used for this request and this request
148-
only. This overrides any API key set via `setGCMAPIKey()`.
154+
- **gcmAPIKey** can be a GCM API key to be used for this request and this
155+
request only. This overrides any API key set via `setGCMAPIKey()`.
149156
- **vapidDetails** should be an object with *subject*, *publicKey* and
150157
*privateKey* values defined. These values should follow the [VAPID Spec](https://tools.ietf.org/html/draft-thomson-webpush-vapid).
151158
- **TTL** is a value in seconds that describes how long a push message is

0 commit comments

Comments
 (0)