> For the complete documentation index, see [llms.txt](https://docs.hablla.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hablla.com/hablla-docs-en/hablla/settings/connections-and-integrations/webchat/how-to-test-your-webchat-locally.md).

# How to test your webchat locally

Test Hablla's Webchat before publishing: build an HTML file in VS Code, insert the integration script, and preview the widget with the Live Server extension.

**Before publishing the Webchat** on the production site, it is possible to test it locally to preview and check its behavior. For that, we prepared this short practical guide.

{% hint style="warning" %}
**This section is intended for people with more advanced technical knowledge.** Local testing involves editing HTML files and using development tools.
{% endhint %}

### Recommended tools for local testing

If you are not familiar with this kind of tool, consider sending this guide to a technical person who can carry out the tests with you.

Both tools need to be installed on the same machine where the test will be performed.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-cover data-type="image">Cover image</th></tr></thead><tbody><tr><td><h3>Visual Studio Code (VS Code)</h3></td><td><em>You need to install the program on the machine, if it is not already installed.</em></td><td data-object-fit="contain"><a href="https://icon.icepanel.io/Technology/svg/Visual-Studio-Code-(VS-Code).svg">https://icon.icepanel.io/Technology/svg/Visual-Studio-Code-(VS-Code).svg</a></td></tr><tr><td><h3>Live Server extension</h3></td><td><em>You need to install the extension inside your VS Code</em></td><td data-object-fit="contain"><a href="https://ritwickdey.gallerycdn.vsassets.io/extensions/ritwickdey/liveserver/5.7.10/1772184436918/Microsoft.VisualStudio.Services.Icons.Default">https://ritwickdey.gallerycdn.vsassets.io/extensions/ritwickdey/liveserver/5.7.10/1772184436918/Microsoft.VisualStudio.Services.Icons.Default</a></td></tr></tbody></table>

{% stepper %}
{% step %}

### 1. Create a folder in VS Code

The project needs to be inside a folder to work correctly.
{% endstep %}

{% step %}

### 2. Create an HTML file

You can create any file for testing purposes. The only requirement is that it has the extension **`.html`**
{% endstep %}

{% step %}

### 3. Generate the HTML structure in the created file

In VS Code, you can use a shortcut to quickly generate the HTML structure:

* **Step 1:** inside the file, type **`!`**.
* **Step 2:** the editor will display ready-made HTML structure options. Just select one of them by pressing **`Enter`** or clicking on the displayed option.
  {% endstep %}

{% step %}

### 4. Insert the Webchat Integration Script

Now that you already have the file structure ready, **paste** the **Webchat Integration Script** that you copied in the additional settings of your connection. This code should be inserted **after the tag&#x20;**<kbd>**\<body>**</kbd>**&#x20;of the created structure.**

{% hint style="info" %}
Don't know where to find this code? Go to the section [Integration Script](https://docs.hablla.com/hablla-docs-en/hablla/settings/connections-and-integrations/webchat/pages/999928eb3bb649f9435b5518bb87e1313a38b4a6#id-2.1.-script-de-integracao).
{% endhint %}
{% endstep %}

{% step %}

### 5. Open the file with the Live Server extension

Now that you have finished the settings, just **Save** the changes and open your file using the Live Server extension in VS Code. To do this, use the shortcut **`Ctrl`**` ``+`` `**`S`** to save and then right-click on the file and select the option **"Open with Live Server".**

<figure><img src="https://1879311494-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrmxWrIrMauHcIrsuqfGq%2Fuploads%2FJAUJMkGaTGKI9cKxG6LL%2F[DOCS]%20-%20Testando%20Webchat%20Localmente.gif?alt=media&#x26;token=d915c85a-adc4-497a-98e0-212a3f2c65ce" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hablla.com/hablla-docs-en/hablla/settings/connections-and-integrations/webchat/how-to-test-your-webchat-locally.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
