How to trigger a Help Article from Javascript
See how to use the Widget Javascript API
Published on October 24, 2023In this guide, you'll learn how to control and interact with the widget on your website using JavaScript. The widget provides a seamless way to integrate additional content and features into your web page. By leveraging the widget's API, you can programmatically show, hide, and navigate through articles and steps within the articles. Below are the steps on how to use the four key API functions provided.
Show widget
To display the widget on your page, you will use the
synced_so.show()
method. This function requires no arguments and will make the widget visible to the users.Show an Article
In some cases, you might want to direct the user to a specific article within the widget. You can achieve this by using the
synced_so.showTopic()
method. This method requires a single argument: the URL of the topic you want to display.Replace
'topicUrl'
with the actual URL of the topic you want to display. eg- https://help.synced.so/article/how-to-link-notion-and-set-up-a-new-help-center
When this method is called, the widget will navigate to the specified article.Show a Step in the Article
To further guide the user, you might want to direct them to a specific step within an article. This can be done using another function, the details of which will be provided below:
You can get this link by clicking on the šĀ icon on the Articleās heading
Ā
Ā
The url will be something like this
https://help.synced.so/article/how-to-link-notion-and-set-up-a-new-help-center#0ebf348c3ca747989b66933b8df98d6b
Ā
If at any point you want to hide the widget from the view, you can use the
synced_so.hide()
method. Similar to the show method, this function requires no arguments.Calling this method will hide the widget from the user, but remember, the widget's state is retained, so when you show it again, it will be in the same state it was when it was hidden.
Did this answer your question?