Prerequisites
Before you begin, make sure you have:- A WorkBuddy kiosk API key (provided by your account admin)
- The API base URL for your environment
- Familiarity with WebSocket connections and audio streaming concepts
For Web Applications
No additional packages are required. The integration uses native browser APIs:| API | Purpose |
|---|---|
| WebSocket | Real-time bidirectional communication |
| Web Audio API | Microphone capture and audio playback |
| getUserMedia | Access to the device microphone |
For Flutter Applications
Add these dependencies to yourpubspec.yaml:
Security Best Practices
Your API key grants access to voice sessions on your account. Treat it as a sensitive credential.- Never hardcode API keys in client-side source code
- Use environment variables or secure configuration management
- For web apps, proxy the token request through your own backend to avoid exposing the key
- For mobile/desktop apps, use encrypted storage or environment files
- Add
.envto your.gitignore
Integration Overview
The integration follows a simple three-step flow:- Authenticate — POST your API key to get a short-lived session token
- Connect — Open a WebSocket and send the token as the first message
- Stream — Send microphone audio and receive AI responses as raw PCM frames