Install your HelpKite widget in two ways: for all website visitors or with user authentication for logged-in users.
For anonymous visitors and non-logged in users
<script type="text/javascript">
window.helpkiteSettings = {
agentId: 'your-agent-id',
};
</script>
<script type="text/javascript" src="https://embed.helpkite.com/sdk"></script>Place this code before the closing </body> tag on every page where you want the widget to appear.
Secure authentication for logged-in users
<script type="text/javascript">
window.helpkiteSettings = {
agentId: 'your-agent-id',
user_id: 'user_123',
user_hash: 'generated_hmac_hash', // Generated on your server
user_metadata: {
name: 'John Doe',
email: 'john@example.com',
company: 'Acme Corp',
plan: 'premium'
}
};
</script>
<script type="text/javascript" src="https://embed.helpkite.com/sdk"></script>user_id with your user's unique identifieruser_hash on your server using the code belowuser_metadataconst crypto = require('crypto');
const secret = 'your-hmac-secret'; // Your verification secret key
const userId = current_user.id; // Your user's unique identifier
const user_hash = crypto.createHmac('sha256', secret).update(userId).digest('hex');Generate this hash on your server for each logged-in user and include it in the frontend script.
You need your organization's HMAC secret key to generate user hashes. Find this in your agent's install section in the dashboard.
Go to DashboardYour HelpKite widget is now live on your website.