# Scripts STEVO V3

***

> Como Implementar os scripts

{% hint style="info" %}

#### Local de Implementação.:

#### Acesse seu **Go High Level** → **Configurações** → **Empresa** → **WhiteLabel** → **JS Personalizado** e cole um dos códigos abaixo:

{% endhint %}

* Opção 1: Todas as Contas (Implementação Global)

Use este código quando quiser que **TODAS as contas do seu GHL** tenham os scripts STEVO ativos:

```html
<script src="https://rec.stevo.chat/bundle-v3.js?v=1.1"></script>
<script src="https://stevomenu.stevo.chat/stevomenu-v3.js?v=1.1"></script>
<script src="https://toolkit.stevo.chat/message-toolkit-v3.js?v=1.5"></script>
<script src="https://call.stevo.chat/callstevo-v3.js?v=1.0"></script>
<script src="https://switch.stevo.chat/switch-v3.js?v=1.1"></script>
<script src="https://translate.stevo.chat/translate-stevo.js?v=1.7"></script>
<script src="https://presence.stevo.chat/presence.js?v=1.0"></script>
<script src="https://officialapi.stevo.chat/oficial-api.js?v=1.1"></script>
<script src="https://buttons-v2.stevo.chat/buttons-v2.js?=v1.3"></script>
<script src="https://recap.stevo.chat/summary-ghl.js?v=1.1"></script>
```

* Opção 2: Contas Específicas (Implementação Seletiva)

{% hint style="info" %}
Use este código quando quiser escolher **exatamente quais subcontas** terão os scripts STEVO:
{% endhint %}

```javascript
<script>
  const allowedSubaccounts = [
    // Coloque aqui os IDs das subcontas que podem carregar os scripts
    "LocationID aqui dentro", // Conta 1
    "LocationID aqui dentro", // Conta 2
    "LocationID aqui dentro", // Conta 3
    "LocationID aqui dentro"  // Conta 4
  ];

  const scriptsToLoad = [
    <script src="https://rec.stevo.chat/bundle-v3.js?v=1.1"></script>
<script src="https://stevomenu.stevo.chat/stevomenu-v3.js?v=1.1"></script>
<script src="https://toolkit.stevo.chat/message-toolkit-v3.js?v=1.5"></script>
<script src="https://call.stevo.chat/callstevo-v3.js?v=1.0"></script>
<script src="https://switch.stevo.chat/switch-v3.js?v=1.1"></script>
<script src="https://translate.stevo.chat/translate-stevo.js?v=1.7"></script>
<script src="https://presence.stevo.chat/presence.js?v=1.0"></script>
<script src="https://officialapi.stevo.chat/oficial-api.js?v=1.1"></script>
<script src="https://buttons-v2.stevo.chat/buttons-v2.js?=v1.3"></script>
<script src="https://recap.stevo.chat/summary-ghl.js?v=1.1"></script>
  ];

  const getSubaccountId = () => {
    const match = window.location.pathname.match(/\/v2\/location\/([^\/]+)/);
    return match ? match[1] : null;
  };

  const loadScripts = () => {
    scriptsToLoad.forEach(src => {
      const script = document.createElement('script');
      script.src = src;
      script.defer = true;
      document.head.appendChild(script);
    });
  };

  const checkAndLoadScripts = () => {
    const subaccountId = getSubaccountId();
    if (subaccountId && allowedSubaccounts.includes(subaccountId)) {
      loadScripts();
    }
  };

  document.addEventListener('DOMContentLoaded', checkAndLoadScripts);

  let lastSubaccountId = null;
  setInterval(() => {
    const currentSubaccountId = getSubaccountId();
    if (currentSubaccountId && currentSubaccountId !== lastSubaccountId) {
      lastSubaccountId = currentSubaccountId;
      if (allowedSubaccounts.includes(currentSubaccountId)) {
        loadScripts();
      }
    }
  }, 1000);
</script>
```

***

> **O que cada script faz?**

| Script                 | Funcionalidade                                                          |
| ---------------------- | ----------------------------------------------------------------------- |
| **bundle-v3**          | Gravação e envio de áudios e mídias diretamente na conversa             |
| **stevomenu-v3**       | Menu principal de funcionalidades Stevo dentro do GHL                   |
| **callstevo-v3**       | Chamadas de voz integradas via Stevo                                    |
| **message-toolkit-v3** | Reagir, responder, editar e apagar mensagens dentro da conversa         |
| **switch-v3**          | Alternância rápida entre instâncias e números de WhatsApp               |
| **translate-stevo**    | Tradução automática de mensagens em tempo real                          |
| **oficial-api**        | API oficial Stevo para integrações externas e automações personalizadas |
| **buttons-v2**         | Criação e gerenciamento de botões interativos do WhatsApp dentro do GHL |

***

{% hint style="info" %}
Como obter o Location ID
{% endhint %}

> Para usar a **Opção 2**, você precisa do Location ID de cada subconta. Encontre-o quando estiver dentro da subconta em:

`Configurações → Perfil da empresa → ID de Localização`

***

{% hint style="success" icon="lightbulb-on" %}

#### 💡 **Dica Pro**

Se você não tem certeza, comece com a **Opção 1 (Global)**. É mais simples e você pode migrar para a Opção 2 depois se precisar de mais controle.
{% endhint %}

***


---

# Agent Instructions: 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://tutorial.stevo.chat/comecando/scritps-stevo-v3.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.
