JavaScript Client
SDK Client
Constructor
parameter | type | description |
---|---|---|
|
| required |
|
| required |
|
| required |
|
| required, value: |
|
| required only for Safari integration |
|
| optional, path to |
Methods
isPushSupport(): Promise<void>
isPushSupport(): Promise<void>
Check if the browser supports web push notifications
isSubscribed(): Promise<boolean>
isSubscribed(): Promise<boolean>
Check if subscriber is registered
register(options?: ISubscribeOptions): Promise<string>
register(options?: ISubscribeOptions): Promise<string>
Register new subscriber - show popup dialog or native permission window
returns
subscriberId
parameter | type | description |
---|---|---|
|
| optional |
|
| optional |
unsubscribe(): Promise<void>
unsubscribe(): Promise<void>
Unsubscribe existing subscriber at database
checkPermission(): Promise<boolean>
checkPermission(): Promise<boolean>
Check for native permission
appendTags(tags: string[]): Promise<string[]>
appendTags(tags: string[]): Promise<string[]>
Append tags to store. For tag with labels support use labelName:tagName
syntax.
parameter | type | description |
---|---|---|
|
|
setCustomId(customId: string | number): Promise<void>
setCustomId(customId: string | number): Promise<void>
Sets customId in cloned store
removeTags(tags: string[]): Promise<string[]>
removeTags(tags: string[]): Promise<string[]>
Remove tag(s) by label from store For labels support please use 'labelName:tagName'
syntax
setSelector(selectorName: string, value: string | number | null | boolean): Promise<void>
setSelector(selectorName: string, value: string | number | null | boolean): Promise<void>
Set selector value - field must be declared in application first
send(immediately?: boolean): Promise<boolean>
send(immediately?: boolean): Promise<boolean>
Set beacon to send on event before unload
getCustomId(): Promise<string>
getCustomId(): Promise<string>
returns
subscriber's customId
getId(): Promise<string>
getId(): Promise<string>
returns
subscriberId
getTags(): Promise<string[]>
getTags(): Promise<string[]>
returns
current subscriber's tags
getTagsToRemove(): Promise<string[]>
getTagsToRemove(): Promise<string[]>
returns
subscriber's tags to remove
clearState(): void
clearState(): void
Clear state, reset values
Last updated