How can we help? 👋

Opening the widget

Learn how to programatically open a single article on your website

Last updated on January 7, 2022

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:

  1. Navigate to the Knowledge Base tab,
  1. Find your desired article
  1. Click on the Copy ⬇️ button
  1. Select either Open Article Code to copy the full javascript function or Article ID to just obtain the specific id.
Notion image

Popover vs Sidebar view

Here you can see the visual difference between 'popover' and 'sidebar'

view
view 'popover'
view
view 'sidebar'
 
 
Did this answer your question?
😞
😐
🤩