Install the live chat widget on Go
XACUBE puts a live chat widget on your Go 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 your basehtml/templatelayout. - 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
mac := hmac.New(sha256.New, []byte(os.Getenv("XACUBE_SECRET_KEY")))
mac.Write([]byte(userID))
hash := hex.EncodeToString(mac.Sum(nil))
<script src="https://chat.xacube.chat/w.js" data-key="YOUR_PUBLIC_KEY"
data-user-id="{{.UserID}}"
data-user-hash="{{.Hash}}"
data-user-name="{{.UserName}}"
data-user-email="{{.UserEmail}}" async></script>