Install the live chat widget on Django
XACUBE puts a live chat widget on your Django site, so your live agents can answer visitors the moment they ask, from one shared inbox. The free plan covers one agent.
- Open
templates/base.htmland paste the code just before</body>. - Publish your site. The chat appears on every page.
<script src="https://chat.xacube.chat/w.js" data-key="YOUR_PUBLIC_KEY" async></script>
Replace YOUR_PUBLIC_KEY with your own key. In your panel, open your website and this code is shown with your key already in it.
Recognise signed-in customers
# In a context processor or view:
import hashlib, hmac
xacube_hash = hmac.new(settings.XACUBE_SECRET_KEY.encode(), str(request.user.pk).encode(), hashlib.sha256).hexdigest()
<!-- templates/base.html -->
<script src="https://chat.xacube.chat/w.js" data-key="YOUR_PUBLIC_KEY"
data-user-id="{{ request.user.pk }}"
data-user-hash="{{ xacube_hash }}"
data-user-name="{{ request.user.get_full_name }}"
data-user-email="{{ request.user.email }}" async></script>