Skip to main content

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:
APIPurpose
WebSocketReal-time bidirectional communication
Web Audio APIMicrophone capture and audio playback
getUserMediaAccess to the device microphone
Supported browsers: Chrome, Edge, Firefox, Safari (latest versions).

For Flutter Applications

Add these dependencies to your pubspec.yaml:
dependencies:
  web_socket_channel: ^2.4.0   # WebSocket client
  record: ^5.0.0               # Microphone capture (PCM)
  flutter_sound: ^9.0.0        # Audio playback (PCM stream)
  http: ^1.0.0                 # HTTP client for token endpoint
  permission_handler: ^11.0.0  # Runtime permission requests

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 .env to your .gitignore

Integration Overview

The integration follows a simple three-step flow:
  1. Authenticate — POST your API key to get a short-lived session token
  2. Connect — Open a WebSocket and send the token as the first message
  3. Stream — Send microphone audio and receive AI responses as raw PCM frames
Continue to the Authentication page to learn how to obtain your session token.