SDK Events

The SDK emits events for all important events. These events can be listened for in order to execute custom logic like tracking, visual changes, or any other action that should occur after an event.

Event

Emit Trigger

on_loaded

The SDK has been successfully loaded in to the visitor's browser

on_load_error

There was an unexpected error while attempting to load the SDK

on_web_push_supported

The visitor's web browser supports web push

on_web_push_unsupported

The visitor's web browser does not support web push

on_ready

The SDK has gather all required configuration and is ready for interaction

on_prompt_eligible

The visitor is eligible to be shown the prompt

on_prompt_ineligible

The visitor should not be shown the prompt

on_prompt_shown

After a prompt is successfully shown to the visitor

on_prompt_dismissed

After a visitor dismisses the prompt

on_prompt_allowed

After a visitor allows the prompt

on_permission_shown

After the visitor is shown the browser's native permission dialog

on_permission_allowed

After the visitor allows the browser's native permission dialog

on_permission_denied

After the visitor declines the browser's native permission dialog

on_permission_dismissed

After the visitor dismisses the browser's native permission dialog

Example: on_ready

For example, to run your own custom code once the SDK is ready for interaction:

pushly('on_ready', function() {
  console.log('example');
});

Last updated