Documentazione

Avvio rapido

Aggiungi il widget di chat Respondo al tuo sito web in meno di 2 minuti.

Aggiungi lo script

Incolla questo snippet prima di </body> su ogni pagina in cui vuoi il widget:

HTML
<script>
  window.Respondo = window.Respondo || {};
  Respondo.init = Respondo.init || function(c) { window.RespondoAIConfig = c; };
  Respondo.q = Respondo.q || [];
  Respondo.identify = Respondo.identify || function(d) { Respondo.q.push(['identify', d]); };
  Respondo.init({
    agentId: 'YOUR_AGENT_ID',
    channelId: 'YOUR_CHANNEL_ID'
  });
</script>
<script src="https://api.respondo.ai/widget/widget.js" async></script>
Sostituisci YOUR_AGENT_ID e YOUR_CHANNEL_ID con l’Agent ID e il Channel ID delle impostazioni del tuo canale (oppure copia lo snippet precompilato dalla pagina del canale). Il widget si carica in modo asincrono e non influirà sulle prestazioni della pagina.

Usi un framework?

Lo stesso widget, integrato nel tuo stack — scegli una scheda:

Renderizza questo componente una volta, vicino alla radice della tua app:

Reacttsx
// respondo-widget.tsx — render once, near the root of your app
import { useEffect } from 'react';

export function RespondoWidget() {
  useEffect(() => {
    const w = window as any;
    w.Respondo = w.Respondo || {};
    w.Respondo.init = w.Respondo.init || function (c) { w.RespondoAIConfig = c; };
    w.Respondo.q = w.Respondo.q || [];
    w.Respondo.identify = w.Respondo.identify || function (d) { w.Respondo.q.push(['identify', d]); };
    if (!document.querySelector('script[data-respondo]')) {
      w.Respondo.init({
        agentId: 'YOUR_AGENT_ID',
        channelId: 'YOUR_CHANNEL_ID'
      });
      const s = document.createElement('script');
      s.src = 'https://api.respondo.ai/widget/widget.js';
      s.async = true;
      s.dataset.respondo = '1';
      document.body.appendChild(s);
    }
  }, []);

  return null;
}
Sostituisci YOUR_AGENT_ID / YOUR_CHANNEL_ID con i valori delle impostazioni del tuo canale — oppure copia lo snippet già pronto dalla pagina del canale, dove sono già compilati.

Identifica gli utenti (consigliato)

Dopo che l’utente ha effettuato l’accesso, chiama identify() per collegare le sessioni di chat al suo profilo:

JavaScript
Respondo.identify({
  email: 'user@example.com',
  name: 'John Doe',
  userId: 'usr_12345',       // il tuo ID utente interno
  metadata: {                // eventuali campi personalizzati
    plan: 'premium',
    company: 'Acme Inc'
  },
  properties: {              // proprietà di contatto personalizzate (definite in Agent Settings)
    account_type: 'enterprise',
    region: 'eu-west'
  }
});

Fatto!

Il widget apparirà nell’angolo in basso a destra. Tutte le conversazioni confluiscono automaticamente nella tua dashboard Conversazioni.