> For the complete documentation index, see [llms.txt](https://docs.jedidesk.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jedidesk.com/api-documentation/inicializaciya-vidzheta.md).

# Ініціалізація віджета

Основні налаштування віджету, якими можна керувати на сторінці [Налаштування віджета](https://app.jedidesk.com/settings-widget) - є глобальними для віджета, не залежно від того, де розміщено ваш віджет.

Для відображення одного віджету по-різному на різних сторінках сайту, є можливість налаштувати деякі параметри при його ініціалізації.&#x20;

За замовчуванням, для генерації віджета використовується код:

***

```
window.jediDeskSettings = {
    token: "1111163635543333335527444444375555504f4141",
};
```

***

Параметр jediDeskSettings можна розширити і встановлювати такі змінні:

| **Параметр** | **Тип**                                                                                        | **Опис**                                                                                                                                                                                                                                           |
| ------------ | ---------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| language     | <p>enum</p><p>Можливі варіанти: da, de, en, es, fi, fr, ja, ko, nl, no, pl, pt, ru, sv, uk</p> | <p>Мова віджета. <br></p><p><mark style="color:red;"><strong>Важливо</strong></mark>: налаштування текстів кожної із мов повинно бути проведено до використання на <a href="https://app.jedidesk.com/settings-widget">сторінці налаштувань</a></p> |
| autoOpen     | boolean                                                                                        | <p>Показник, чи відкривати автоматично віджет при завантаженні сторінки. <br><br>За замовчуванням - <strong>false</strong></p>                                                                                                                     |
| alwaysOpen   | boolean                                                                                        | <p>Показник, чи блокувати можливість закрити віджет. <br><br>Віджет буде завжди відкритий на сайті. <br><br>Працює в парі з параметром <strong>autoOpen</strong>.<br></p><p>За замовчуванням -  <strong>false</strong></p>                         |

***

**Приклад, як можна вказати мову віджета при ініціалізації** (корисно використовувати, якщо на сайті дві і більше мовних версій):

***

```
window.jediDeskSettings = {
    token: "1111163635543333335527444444375555504f4141",
    language: "uk"
};
```

***

{% hint style="info" %}
За замовчуванням якщо в налаштуваннях активно більше 1 мови, мова віджету буде дорівнювати мові браузера користувача, або мові за замовчуванням, якщо мова користвувача не знайдена в активних.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.jedidesk.com/api-documentation/inicializaciya-vidzheta.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
