Install the live chat widget on PHP
XACUBE puts a live chat widget on your PHP site, so your live agents can answer visitors the moment they ask, from one shared inbox. The free plan covers one agent.
- Paste the code just before
</body>in the footer file your pages include. - 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
<?php $hash = hash_hmac('sha256', (string) $user_id, getenv('XACUBE_SECRET_KEY')); ?>
<script src="https://chat.xacube.chat/w.js" data-key="YOUR_PUBLIC_KEY"
data-user-id="<?= htmlspecialchars($user_id) ?>"
data-user-hash="<?= $hash ?>"
data-user-name="<?= htmlspecialchars($user_name) ?>"
data-user-email="<?= htmlspecialchars($user_email) ?>" async></script>