Opening the widget
Learn how to programatically open a single article on your website
It seems like you are looking for a way to programatically open the HelpKit widget? You have come to the right place. Using our widget API is super simple.
Helpkit.show()
To open the widget you can use the Helpkit.show()
function.
Helpkit.show(view, type?, articleId?)
Parameter | Data Structure | Value | Optional |
view | String | ‘popover’ | ‘sidebar’ | No |
type | String | ‘article’ | ‘contact’ | Yes |
articleId | String | 'your_article_page_id' | Yes |
Opening the widget
In order to open the widget within your website all you have to do is define the view
parameter
Example of a button with an event listener that displays the widget 👇
<button onclick="Helpkit.show('popover')">Open the widget</button>
Opening a single article
In order to open a single article within your website you have to define all three parameters.
Example of a button with an event listener that displays a single article 👇
<button onclick="Helpkit.show('popover', 'article', 'qYFazNTSwDkVohWu9S5rbe')">Open the widget</button>
Opening the contact form
In order to open the HelpKit contact form use the type
’contact’ as your parameter.
Example of a button with an event listener that displays a single article 👇
<button onclick="Helpkit.show('popover', 'contact')">Contact us</button>
Getting the articleId
In order to obtain the articleId
string simply:
- Navigate to the Knowledge Base tab,
- Find your desired article
- Click on the
Copy ⬇️
button
- Select either
Open Article Code
to copy the full javascript function orArticle ID
to just obtain the specific id.
Popover vs Sidebar view
Here you can see the visual difference between 'popover' and 'sidebar'
Last updated on August 4, 2021