You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Builds an HTTP request body and headers for sending a push notification.
7
8
*
9
+
* This function constructs the necessary components for a push notification request,
10
+
* including the payload, headers, and any required cryptographic operations.
11
+
*
8
12
* @param {BuilderOptions} options - The options for building the push notification request.
9
13
* @param {JsonWebKey | string} options.privateJWK - The private JSON Web Key (JWK) used for signing.
10
-
* @param {PushMessage} options.message - The message to be sent in the push notification with userdefined options.
14
+
* @param {PushMessage} options.message - The message to be sent in the push notification, including user-defined options.
11
15
* @param {PushSubscription} options.subscription - The subscription details for the push notification.
16
+
* @returns {Promise<{ endpoint: string, body: ArrayBuffer, headers: Record<string, string> | Headers }>} A promise that resolves to an object containing the endpoint, encrypted body, and headers for the push notification.
12
17
*
13
-
* @throws {Error} Throws an error if the privateJWK is invalidor if the request fails.
18
+
* @throws {Error} Throws an error if the privateJWK is invalid, if the request fails, or if the payload encryption fails.
0 commit comments