Home > borogove > Client > subscribePush

Client.subscribePush() method

Create a browser push subscription and register it with the server

Signature:

subscribePush(reg: ServiceWorkerRegistration, push_service: string, vapid_key: {privateKey: CryptoKey, publicKey: CryptoKey}, grace?: number | null): void;

Parameters

Parameter Type Description
reg ServiceWorkerRegistration service worker registration that owns the PushManager
push_service string address of the push proxy
vapid_key {privateKey: CryptoKey, publicKey: CryptoKey} VAPID key pair used for push registration
grace number | null (Optional) optional push suppression grace period, in seconds

Returns:

void