Skip to content

Commit 0bc206d

Browse files
paullessingmarco-c
authored andcommitted
Update docs (#377)
Public and private keys must be strings `payload` when sending can be a string or buffer
1 parent 51fe347 commit 0bc206d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/vapid-helper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,8 @@ function validateExpiration(expiration) {
161161
* @param {string} audience This must be the origin of the push service.
162162
* @param {string} subject This should be a URL or a 'mailto:' email
163163
* address.
164-
* @param {Buffer} publicKey The VAPID public key.
165-
* @param {Buffer} privateKey The VAPID private key.
164+
* @param {string} publicKey The VAPID public key.
165+
* @param {string} privateKey The VAPID private key.
166166
* @param {string} contentEncoding The contentEncoding type.
167167
* @param {integer} [expiration] The expiration of the VAPID JWT.
168168
* @return {Object} Returns an Object with the Authorization and

src/web-push-lib.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ WebPushLib.prototype.setGCMAPIKey = function(apiKey) {
4747
* @param {string} subject This must be either a URL or a 'mailto:'
4848
* address. For example: 'https://my-site.com/contact' or
4949
* 'mailto: [email protected]'
50-
* @param {Buffer} publicKey The public VAPID key.
51-
* @param {Buffer} privateKey The private VAPID key.
50+
* @param {string} publicKey The public VAPID key, a URL safe, base64 encoded string
51+
* @param {string} privateKey The private VAPID key, a URL safe, base64 encoded string.
5252
*/
5353
WebPushLib.prototype.setVapidDetails =
5454
function(subject, publicKey, privateKey) {
@@ -75,7 +75,7 @@ WebPushLib.prototype.setVapidDetails =
7575
* This method will throw an error if there is an issue with the input.
7676
* @param {PushSubscription} subscription The PushSubscription you wish to
7777
* send the notification to.
78-
* @param {string} [payload] The payload you wish to send to the
78+
* @param {string|Buffer} [payload] The payload you wish to send to the
7979
* the user.
8080
* @param {Object} [options] Options for the GCM API key and
8181
* vapid keys can be passed in if they are unique for each notification you
@@ -273,7 +273,7 @@ WebPushLib.prototype.generateRequestDetails =
273273
* payload and any options.
274274
* @param {PushSubscription} subscription The PushSubscription you wish to
275275
* send the notification to.
276-
* @param {string} [payload] The payload you wish to send to the
276+
* @param {string|Buffer} [payload] The payload you wish to send to the
277277
* the user.
278278
* @param {Object} [options] Options for the GCM API key and
279279
* vapid keys can be passed in if they are unique for each notification you

0 commit comments

Comments
 (0)