Install the live chat widget on ASP.NET Core
XACUBE puts a live chat widget on your ASP.NET Core site, so your live agents can answer visitors the moment they ask, from one shared inbox. The free plan covers one agent.
- Open
Views/Shared/_Layout.cshtmland 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
@using System.Security.Cryptography
@using System.Text
@{
var secret = Encoding.UTF8.GetBytes(Configuration["XacubeSecretKey"]);
var hash = Convert.ToHexString(HMACSHA256.HashData(secret, Encoding.UTF8.GetBytes(userId))).ToLowerInvariant();
}
<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>