StorySDK Documentations
  • Welcome
  • SDK Integrations
    • How to get SDK token
    • Web SDK
    • React Native
    • iOS SDK
  • Cordova
  • Tutorial
    • Create account
    • Stories Witget
    • Adding New App
    • Adding New Stories Group
    • Adding New Story
    • Editor
    • Widgets
      • Button
    • Stories size
    • Integrations
      • Google Analytics
Powered by GitBook
On this page
  • Actions
  • Custom action

Was this helpful?

  1. Tutorial
  2. Widgets

Button

A button widget that can be used for navigating stories, as a link, or for implementing a custom scenario within your application.

PreviousWidgetsNextStories size

Last updated 3 months ago

Was this helpful?

Actions

Custom action

To add custom action select "Custom" in the "Link&action" dropdown menu.

Web

To use a custom action in the WebSDK, provide the necessary information in the Web field. For example, you can enter details such as the navigation path or screen name. Then, handle the button click event to capture this data.

To handle the event, get a container with the following HTML selector -#storysdk:

const container = document.querySelector('#storysdk');

Add event listener to listen 'storysdk_custom_click' event:

container.addEventListener('storysdk_custom_click', (event) => {
    console.log('my custom data', event.detail.data);
    // Wtrite your code here
});

To retrieve the data you entered, use the event.detail.data field inside the event listener.