JavaScript Client
new Client(config_params)
parameter | type | description |
---|---|---|
projectId | string | required |
vapidPublicKey | string | required |
isHTTPS | boolean | required |
endpoint | string | required, value: https://api.pushpushgo.com |
websitePushId | string | required only for Safari integration |
swPath | string | optional, path to sw.js file when other than root |
Check if the browser supports web push notifications
Check if subscriber is registered
Register new subscriber - show popup dialog or native permission window
returns
subscriberIdparameter | type | description |
---|---|---|
fields | { customId?: string} | optional |
tags | string[] | optional |
Unsubscribe existing subscriber at database
Check for native permission
Append tags to store. For tag with labels support use
labelName:tagName
syntax.parameter | type | description |
---|---|---|
tags | string[] | |
Sets customId in cloned store
Remove tag(s) by label from store For labels support please use
'labelName:tagName'
syntaxSet selector value - field must be declared in application first
Set beacon to send on event before unload
returns
subscriber's customIdreturns
subscriberIdreturns
current subscriber's tagsreturns
subscriber's tags to removeClear state, reset values
Last modified 11mo ago