View Categories

Cómo instalar WhatChat en tu sitio web Gatsby: guía paso a paso para integrar chat en vivo

Si tienes un sitio web creado con Gatsby, puedes agregar un widget de chat en vivo de WhatChat y comunicarte con tus visitantes en tiempo real. Esto se puede hacer en 3 sencillos pasos utilizando el plugin de WhatChat para Gatsby.

Paso 1: Añadir el plugin de Gatsby a tu proyecto #

Agrega gatsby-plugin-whatchat a tu proyecto de Gatsby.

npm install --save gatsby-plugin-whatchat

Si estás utilizando yarn, usa lo siguiente:

yarn add gatsby-plugin-whatchat

Paso 2: Añadir el plugin a tu archivo de configuración de Gatsby #

// En tu gatsby-config.js
plugins: [
  {
    resolve: `gatsby-plugin-whatchat`,
    options: {
      baseUrl: "BASE_URL", // Requerido
      websiteToken: "WEBSITE_TOKEN", // Requerido
      includeInDevelopment: false, // Opcional
      whatchatSettings: {}, // Opcional
    },
  },
];

Puedes obtener tu token de sitio web y la URL base desde la configuración de tu bandeja de entrada en tu cuenta de WhatChat.

Si necesitas crear un nuevo canal de sitio web, sigue el procedimiento ilustrado aquí.

Paso 3: Inicia tu servidor #

Ahora podrás ver el widget de WhatChat en la página.