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
/// Returns the origin for the receiving URL, as defined for use in signing headers for VAPID.
13
+
///
14
+
/// This implementation is similar to the [WHATWG Standard](https://url.spec.whatwg.org/#concept-url-origin), except that it uses the unicode form of the host, and is limited to HTTP and HTTPS schemas.
15
+
///
16
+
/// - SeeAlso: [RFC8292 Voluntary Application Server Identification (VAPID) for Web Push §2. Application Server Self-Identification](https://datatracker.ietf.org/doc/html/rfc8292#section-2)
17
+
/// - SeeAlso: [RFC6454 The Web Origin Concept §6.1. Unicode Serialization of an Origin](https://datatracker.ietf.org/doc/html/rfc6454#section-6.1)
18
+
varorigin:String{
19
+
/// Note that we need the unicode variant, which only URLComponents provides.
/// This key should be shared by all instances of your push service, and should be kept secure. Rotating this key is not recommended as you'll lose access to subscribers that registered against it.
16
16
///
17
17
/// Some implementations will choose to use different keys per subscriber. In that case, choose to provide a set of keys instead.
assert(vapidConfiguration.validityDuration <= vapidConfiguration.expirationDuration,"The validity duration must be earlier than the expiration duration since it represents when the VAPID Authorization token will be refreshed ahead of it expiring.");
31
+
assert(vapidConfiguration.expirationDuration <=.hours(24),"The expiration duration must be less than 24 hours or else push endpoints will reject messages sent to them.");
/// - Note: If you supplied multiple keys in your VAPID configuration, you must specify the key ID along with the subscription you received from the browser. This can be easily done client side:
127
+
/// ```js
128
+
/// export async function registerSubscription(subscription, applicationServerKey) {
0 commit comments