@@ -121,6 +121,10 @@ webpush.sendNotification(
121
121
);
122
122
```
123
123
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
+
124
128
### Input
125
129
126
130
** Push Subscription**
@@ -133,19 +137,22 @@ in the browser.
133
137
134
138
** Payload**
135
139
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 ) .
138
145
139
146
> ** Note:** In order to encrypt the * payload* , the * pushSubscription* ** must**
140
147
have a * keys* object with * p256dh* and * auth* values.
141
148
142
149
** Options**
143
150
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 .
146
153
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() ` .
149
156
- ** vapidDetails** should be an object with * subject* , * publicKey* and
150
157
* privateKey* values defined. These values should follow the [ VAPID Spec] ( https://tools.ietf.org/html/draft-thomson-webpush-vapid ) .
151
158
- ** TTL** is a value in seconds that describes how long a push message is
0 commit comments