Javascript API for OnVoard Widgets

You can use the javascript API to make method calls for OnVoard widgets.

Notifier Namespace

# Show notifier
OnVoard('notifier', 'show');

# Hide notifier
OnVoard('notifier', 'hide');

# Close notification
OnVoard('notifier', 'closeNotification');

# Set z-index to fix overlaying issues
OnVoard('notifier', 'setZIndex', 999999);

Trigger callbacks for notifiers

# Execute function when notification is "slide-in"
OnVoard('notifier', 'onSlideIn', () => console.log("onSlideIn");

# Execute function when notification is "slide-out"
OnVoard('notifier', 'onSlideOut', () => console.log("onSlideOut");

Site Modifier Namespace

# Trigger modifications manually. Can be hooked to event calls that gets triggered after HTML elements has been attached to DOM.
OnVoard('site_modifier', 'triggerModifications');

# By default we will continuously poll to check if HTML elements are ready to be modified. 
# You can turn off polling and use `triggerModifications` to update elements manually.
OnVoard('site_modifier', 'stopPolling');

# You only need to execute this if you have previously executed `stopPolling` (to restart polling).
OnVoard('site_modifier', 'startPolling');

Slide-In Web Survey Namespace

This will be applicable for slide-in web survey.

# Show survey
OnVoard('slide_in_web_survey', 'show');

# Hide survey
OnVoard('slide_in_web_survey', 'hide');

# Expand survey
OnVoard('slide_in_web_survey', 'expand');

# Minimize survey
OnVoard('slide_in_web_survey', 'minimize');

# Set respondent trait
OnVoard('slide_in_web_survey', 'setRespondentTrait', {
  key: 'registered_timestamp',
  value: 1560963668,
  valueType: 'timestamp'
});

# Set z-index to fix overlaying issues
OnVoard('slide_in_web_survey', 'setZIndex', 999999);

Trigger callbacks for slide-in web survey

# Execute function when survey is "slide-in"
OnVoard('slide_in_web_survey', 'onSlideIn', () => console.log("onSlideIn");

# Execute function when survey is "slide-out"
OnVoard('slide_in_web_survey', 'onSlideOut', () => console.log("onSlideOut");

# Execute function when survey is expanded
OnVoard('slide_in_web_survey', 'onExpand', () => console.log("onExpand");

# Execute function when survey is minimized
OnVoard('slide_in_web_survey', 'onMinimize', () => console.log("onMinimize");