---
sourceDocument: Interfaces conversacionais de Yokohama
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/yokohama/conversational-interfaces

 Release :

    - yokohama

ft:locale :

    - pt-BR

ft:publication_title :

    - Interfaces conversacionais de Yokohama

ft:clusterId :

    - convint

bundleId :

    - convint

workflow :

    - Platform


---

# Adicione o Portátil Virtual Agentwidget de bate-papo para um site de terceiros

# Adicione o Portátil Virtual Agentwidget de bate-papo para um site de terceiros {#ariaid-title1}

* Versão de lançamento: Yokohama
* 
* Atualizado 30 de jan. de 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 min. de leitura

Para usar o widget de bate-papo portátil para Virtual Agentem páginas da web de terceiros, adicione o código necessário à sua página da web.

## Antes de Iniciar

[Configure o Portátil Virtual Agentwidget de bate-papo](https://servicenow-prod.fluidtopics.net/jYurbZmZGhoFVwHqQvsgWA "Configure o Portátil Virtual Agentwidget de bate-papo a ser executado Virtual Agentem páginas da web de terceiros.") antes de concluir as etapas deste tópico.

Para obter informações adicionais, revise [Como incorporar o Virtual Agent em um site externo](https://www.servicenow.com/community/virtual-agent-nlu-articles/how-to-embed-virtual-agent-in-an-external-site-updated-for-tokyo/ta-p/2308092)artigo sobre Comunidade ServiceNowlocal.

Função necessária: virtual_agent_admin ou admin

## Procedimento

Importe e instancie esta referência de script ao cabeçalho da página para criar um ServiceNowinstância de bate-papo no cabeçalho da página externa:  
Nota:  
No exemplo de referência de script, site1.example.com refere-se ao URL do seu ServiceNowinstância.

    <script type="module" >
          import ServiceNowChat from "https://site1.example.com/uxasset/externals/now-requestor-chat-popover-app/index.jsdbx?sysparm_substitute=false";
          var chat = new ServiceNowChat({ instance: "https://site1.example.com/", });
        </script>

Dica:  
Se sua organização usar um nome de domínio personalizado, insira o nome de domínio personalizado como a propriedade da instância, em vez de ServiceNownome de domínio, para garantir que os resultados do navegador sejam consistentes entre vários navegadores.

Exemplo com configuração
:

        const chat = new ServiceNowChat({
        	instance: 'https://site1.example.com',
        	context: {
        		skip_load_history: 1
        	},
        	branding: {
        		bgColor: '#333',
        		primaryColor: '#000',
        		hoverColor: '#EFEFEF',
        		activeColor: '#AAA',
        		openIcon: 'custom-open.svg',
        		closeIcon: 'custom-close.svg',
        		sizeMultiplier: 1.6
        	},
        	offsetX: 50,
        	offsetY: 50,
        	position: 'left',
        	translations: {
        		'Open dialog': 'Open chat',
        		'Open Chat. {0} unread message(s)': 'Click to open',
        		'Close chat.': 'Click to close',
        	},
        });

Esquema de configuração JSON
:

        {
            instance: <string> - url to your instance, must be of the same domain (sub-domain)
            context: <object> - sys_parm variables to pass into the iframe
            branding: <object> - branding settings
                  bgColor: <rgb|hex> - can take an rgb tuple, ie: '56,56,56' or a 3 or 6 hex color code, ie: #333 or #efefef.  background color of button
           	primaryColor: <rgb|hex> - font color
           	hoverColor: <rgb|hex> - hover background color of button
           	activeColor: <rgb|hex> - click / active background color of button
           	openIcon: <string> - name of the uploaded custom icon in settings
           	closeIcon: <string> - name of the uploaded custom icon in settings
           offsetX: <integer> - distance in pixels the button moves along the x-axis
           offsetY: <integer> - distance in pixels the button moves along the y-axis
           position: <enum: left|right> - position left or right side of screen
           translations: <object> - contains label mappings for translations or label changes
           	'Open dialog': <string> - replacement text for accessibility
           	'Open Chat. {0} unread messages(s)': <string> - replacement text for tooltip
           	'Close chat.': <string> - replacement text for tooltip
        }


