@guidekit/vanilla
v0.1.1
Published
Vanilla JS bundle for GuideKit SDK — script-tag integration
Maintainers
Readme
@guidekit/vanilla
Vanilla JavaScript bundle for the GuideKit SDK. Provides a script-tag integration for adding an AI assistant to any web page without React.
Installation
CDN (IIFE)
<script src="https://unpkg.com/@guidekit/vanilla/dist/index.global.js"></script>
<script>
GuideKit.init({
tokenEndpoint: '/api/guidekit/token',
agent: { name: 'Guide', greeting: 'Hello! How can I help?' },
options: { mode: 'text' },
});
</script>npm
npm install @guidekit/vanillaimport { init, sendText, destroy } from '@guidekit/vanilla';
await init({
tokenEndpoint: '/api/guidekit/token',
agent: { name: 'Guide', greeting: 'Hello!' },
options: { mode: 'text' },
});
// Send a message programmatically
await sendText('How do I get started?');
// Clean up when done
destroy();Imperative API
| Method | Description |
|--------|-------------|
| init(config) | Initialize the SDK and render the widget |
| sendText(message) | Send a text message to the assistant |
| startVoice() | Begin voice input (requires @guidekit/vad) |
| stopVoice() | Stop voice input |
| destroy() | Tear down the SDK and remove the widget |
Documentation
- Full documentation: guidekit-docs.vercel.app/docs/vanilla
- Main README
