init(endpoint:userAgentKeyMaterial:vapidKeyID:)
Initialize a new subscriber manually.
init(endpoint: URL, userAgentKeyMaterial: UserAgentKeyMaterial, vapidKeyID: VAPID.Key.ID)
Prefer decoding a subscription directly with the results of the subscription directly:
const subscriptionStatusResponse = await fetch(`/registerSubscription`, {
method: "POST",
body: {
...subscription.toJSON(),
applicationServerKey: subscription.options.applicationServerKey,
}
});