Authenticated floating chat button with access to private knowledge base
Please sign in to access the private chat widget.
You're now signed in. Look for the chat button in the bottom-right corner.
Add this code to your private portal to embed the authenticated chat button:
<link rel="stylesheet" href="https://your-api-url.com/chatter.css">
<script src="https://your-api-url.com/chatter.js"></script>
<script>
// Get JWT token from your auth system
const jwtToken = await getTokenFromYourAuthSystem();
new Chatter.ChatButton({
host: 'your-api-url.com',
mode: 'private',
apiKey: 'YOUR_API_KEY_HERE',
token: jwtToken,
position: 'bottom-right',
label: '🔒',
chatConfig: {
title: 'Private Chat',
subtitle: 'Internal support'
}
});
</script>
<script>
// Wait for Clerk to load
if (window.Clerk?.session) {
const token = await window.Clerk.session.getToken();
new Chatter.ChatButton({
host: 'your-api-url.com',
mode: 'private',
apiKey: 'YOUR_API_KEY_HERE',
token: token,
position: 'bottom-right'
});
}
</script>
npm install @diegoaltoworks/chatter
import { ChatButton } from '@diegoaltoworks/chatter';
import '@diegoaltoworks/chatter/style.css';
const token = await getYourJWTToken();
new ChatButton({
host: 'your-api-url.com',
mode: 'private',
apiKey: 'YOUR_API_KEY_HERE',
token: token,
position: 'bottom-right'
});
This page embeds the Chatter.ChatButton component in private mode with Clerk authentication:
<link rel="stylesheet" href="https://your-api-url.com/chatter.css">
<script src="https://your-api-url.com/chatter.js"></script>
<script>
// Get JWT token from your auth system (e.g., Clerk)
const jwtToken = await window.Clerk.session.getToken();
new Chatter.ChatButton({
host: 'your-api-url.com',
mode: 'private',
apiKey: 'YOUR_API_KEY_HERE',
token: jwtToken,
position: 'bottom-right',
label: '🔒',
chatConfig: {
title: 'Private Chat',
subtitle: 'Internal support'
}
});
</script>