# Integrate the widget with Chatra _Category: Integrations and API_ Show the widget first and open your Chatra live chat only when a visitor can't find what they need. Visitors get instant answers from your help center, and your team only hears the questions your articles don't cover yet. **Who can do this:** Owners and Admins, with access to your website's code ยท **Plans:** All plans ## Step 1: Install Chatra on your website If Chatra already runs on your website, skip to the next step. 1. Sign in to your Chatra dashboard at [app.chatra.io](https://app.chatra.io/). 2. Go to **Settings**. Under **Channels**, click **Chat widget**. 3. Click **Show setup instructions** below the **Chat widget** heading. 4. Follow the instructions to place your Chatra snippet right before the closing `` tag on every page where you want the chat. ## Step 2: Hide Chatra until it's needed Visitors should only see the chat once they've asked for help, so Chatra starts hidden. Paste this code right before your Chatra snippet: ``` ``` The style hides Chatra's chat button, and `startHidden` tells Chatra to load hidden. The widget opens the chat when it's needed. ## Step 3: Add the widget and connect it to Chatra 1. In your HelpCenter.io dashboard, click the gear icon in the left menu, then **Embeddables**. 2. On the **Widget** tab, click **Copy** on the **Installation** card. The code you copied looks like this, with your own widget ID in place of `ab12c3`: ``` ``` Add a comma after `app_id: 'ab12c3'`, and on the next line add an `onContactsRequest` function that opens Chatra: ``` onContactsRequest: function(){if(window.Chatra){Chatra('show');Chatra('openChat',true);}else{console.error('Unable to find Chatra widget.');}} ``` The finished code looks like this: ``` ``` Paste it right before the closing `` tag of your website or web app. ## How it works Visitors see the widget first and can search your help center or read an article to solve the problem themselves. When they ask to contact you from the widget, for example by clicking **I can't find what I'm looking for**, the widget calls your `onContactsRequest` function instead of showing its own contact form, and Chatra opens. Pay attention to what people ask in the chat, and add an article whenever a new question comes up. Over time, fewer visitors need to reach out with the same question. ## Good to know - The widget stays open when the chat opens. To close it at the same time, add `window.hcWidget.hide();` inside your `onContactsRequest` function. See [Widget JavaScript API](https://developers.helpcenter.io/content/widget-javascript-api) on the developer portal. - Not comfortable editing your website's code? Ask a developer, or [contact us](https://self.helpcenter.io/content/contact-support): we may be able to help. ## Related articles - [Add the widget to your website](https://self.helpcenter.io/content/install-the-widget) - [Integrations overview](https://self.helpcenter.io/content/integrations) - [Handle contact requests yourself](https://developers.helpcenter.io/content/widget-custom-contact) on the developer portal - [Widget JavaScript API](https://developers.helpcenter.io/content/widget-javascript-api) on the developer portal