SDK reference

usePush

Returns subscription helpers and reactive state.

apiBasestringFull URL of the project's API base. Use the value shown in the SDK setup card.
vapidPublicKeystringProject VAPID public key.
userIdstring?Optional — your application user id. Lets the dashboard / REST API target sends to specific users.
swPathstring?Defaults to /sw.js.
swScopestring?Override the SW registration scope (e.g. "/" when serving from a sub-path).

Returned: subscribe(), unsubscribe(), subscription, permission, isSupported, isSubscribing, error.