DNZ Voice Docs
Flutter & Mobile Apps
Mobile apps do not call DNZ with the API key directly. Your backend mints RTC Tokens; the app uses WebRTC (flutter_webrtc) or a native client with the token and channelName.
Recommended flow
1) App authenticates with your API (Firebase, JWT, etc.).
2) App calls YOUR endpoint: POST /api/voice/token { classId }.
3) Your server returns { channelName, token, turnCredentials? }.
4) App connects to voice-api via WebRTC using the token (Socket.IO signaling on /socket.io/).
Flutter — get token from your API
Your mobile app calls your backend; never embed dnz_vk_ in the APK/IPA.
final res = await http.post(
Uri.parse("https://your-api.com/voice/token"),
headers: {"Authorization": "Bearer $userJwt"},
body: jsonEncode({"classId": classId}),
);
final channelName = jsonDecode(res.body)["channelName"];
final token = jsonDecode(res.body)["token"];
// Pass channelName + token to your WebRTC / signaling layerRoles
host — full control, can moderate in moderated mode
speaker — can publish audio
listener — receive only