LitePushClientConfig
interface| Property | Type | Description |
|---|---|---|
| projectId | string | Project ID from the dashboard ( |
| vapidKey | string | The project's VAPID public key. |
| apiBase? | string | Override the API origin. Defaults to |
| swPath? | string | Path the service worker is served from on your origin. Defaults to |
LitePushClient
classConstructor
| Parameter | Type | Description |
|---|---|---|
| config | LitePushClientConfig | — |
Properties
Methods
Whether this browser can actually complete a subscribe. Synchronous, safe anywhere.
Whether this browser currently has an active subscription for the project.
Request permission (if needed), register the service worker, create a PushSubscription, and register it with LitePush. Returns { id } on success or null if the user denied permission. Must be called from a user gesture. Throws on unsupported browsers — gate on canSubscribe().
| Parameter | Type | Description |
|---|---|---|
| opts? | SubscribeOptions | default: {} |
Cancel the current browser's subscription and beacon /v1/unsubscribe so the dashboard updates immediately. Returns true if a subscription was actually removed.
canSubscribe
functionVERSION
constRe-exports
This entry point also re-exports the following shared types: