With the Freshdesk help widget, you can embed solution articles and a contact form within your website or product. When your customers need help, they can open the widget to search through solution articles or to submit a ticket. You can watch this video to learn how to set up the help widget or read more about setting up the help widget here.


You can also make the widget show specific articles when your customers click on a button on your website or product. Instead of providing links that take your customers away from your website/product - you can directly open a particular solution article in the widget using the open article API.


This article will guide you through the process of setting up a button that can open an article directly in the widget. Here's a sample site with this implemented:



First, decide on which button that your customers will have to click on, to open the widget. If you don't already have a button, you'll have to create one first.

  • Sample code for a button:

By the way, this doesn't have to be a button. You can also use any other element, like a link, if that's what you prefer.


2. Creating a function that opens the solution article

Now that you've created the button, you can go ahead and define what needs to happen when it's clicked. You can use a JavaScript function to do so.


A JavaScript function is a piece of code to complete a specific action or set of actions.


In the sample code below, we've defined a function named openWidgetArticle(). The name of the function is only for your reference and can be changed as you wish. The openWidgetArticle() function tells the widget to open a specific article by using the widget API: FreshworksWidget('open', 'article', { id: 123 });


The id:123 refers to the article ID. To find out the article ID, open the article in your customer portal, and refer to the URL. The URL would look something like yourportalname.freshdesk.com/support/solutions/123-this-is-an-article or like this: yourcname.com/support/solutions/123-this-is-an-article



Here, 123 is the article ID.



  • Sample code for the openWidgetArticle() function:

Place this function above the embed code (that you'd have copied from Freshdesk) and within the


Here is a sample page with this implemented.