Que fait Chatwoot ?
Aperçu
Chatwoot est une plateforme de support client open-source. Alternative auto-hébergée à Intercom avec chat en direct, boîte de réception partagée, support multicanal (site web, email, WhatsApp, Telegram, Twitter) et chatbots. Gratuite lorsqu'elle est auto-hébergée.
Instructions
Étape 1 : Déploiement Docker
# docker-compose.yml — Chatwoot auto-hébergé
services:
chatwoot:
image: chatwoot/chatwoot:latest
depends_on: [postgres, redis]
ports: ["3000:3000"]
environment:
RAILS_ENV: production
SECRET_KEY_BASE: your-secret-key-base
FRONTEND_URL: https://chat.example.com
POSTGRES_HOST: postgres
POSTGRES_USERNAME: chatwoot
POSTGRES_PASSWORD: chatwoot
REDIS_URL: redis://redis:6379
MAILER_SENDER_EMAIL: [email protected]
SMTP_ADDRESS: smtp.gmail.com
SMTP_PORT: 587
SMTP_USERNAME: [email protected]
SMTP_PASSWORD: app-password
command: bundle exec rails s -p 3000 -b 0.0.0.0
sidekiq:
image: chatwoot/chatwoot:latest
depends_on: [postgres, redis]
environment: *chatwoot-env
command: bundle exec sidekiq
postgres:
image: postgres:15
environment:
POSTGRES_DB: chatwoot
POSTGRES_USER: chatwoot
POSTGRES_PASSWORD: chatwoot
volumes: [pgdata:/var/lib/postgresql/data]
redis:
image: redis:7-alpine
volumes: [redisdata:/data]
volumes:
pgdata:
redisdata:
Étape 2 : Ajouter le widget de chat
<!-- Ajoutez à votre site web -->
<script>
(function(d,t) {
var BASE_URL="https://chat.example.com";
var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=BASE_URL+"/packs/js/sdk.js";
g.defer = true;
g.async = true;
s.parentNode.insertBefore(g,s);
g.onload=function(){
window.chatwootSDK.run({
websiteToken: 'YOUR_WEBSITE_TOKEN',
baseUrl: BASE_URL
})
}
})(document,"script");
</script>
Étape 3 : Intégration API
// lib/chatwoot.ts — Créer des contacts et des conversations via l'API
const CHATWOOT_URL = 'https://chat.example.com'
const CHATWOOT_TOKEN = process.env.CHATWOOT_API_TOKEN!
// Créer un contact lors de l'inscription d'un utilisateur
await fetch(`${CHATWOOT_URL}/api/v1/accounts/1/contacts`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
api_access_token: CHATWOOT_TOKEN,
},
body: JSON.stringify({
name: 'John Doe',
email: '[email protected]',
custom_attributes: { plan: 'pro', mrr: 49 },
}),
})
Consignes
- Auto-hébergé : entièrement gratuit, agents et conversations illimités.
- Cloud : à partir de 19 $/agent/mois.
- Prend en charge WhatsApp Business, Telegram, Twitter, email et les canaux site web dans une seule boîte de réception.
- Utilisez les webhooks pour synchroniser les conversations avec votre CRM ou système de ticketing.