volorio_server
Backend-only Dart REST client for Volorio session creation, heartbeat, wallet reads, and server-side realtime product orchestration.
Use this package in your own backend. Do not ship it inside a customer Flutter mobile app with a real Volorio API key.
Keywords
Volorio server SDK, Dart backend SDK, Flutter RTC backend, WebRTC token server, voice room backend, API key, project ID, client ID, wallet billing.
Install
dependencies:
volorio_server: ^0.2.0
Required identifiers
Volorio uses three different identifiers:
| Identifier | Required where | Secret? | Purpose |
|---|---|---|---|
clientId |
Session creation body | No | Public application/client identifier for the API key owner |
projectId |
Session creation body | No | Billing, entitlement, wallet, room namespace |
apiKey |
Backend Authorization header |
Yes | Server credential used to create sessions |
Flutter apps may know clientId and projectId, but must not know apiKey.
Create an RTC voice session
import 'dart:io';
import 'package:volorio_core/volorio_core.dart';
import 'package:volorio_server/volorio_server.dart';
final volorio = VolorioServerClient(
apiBaseUrl: 'https://api.volor.io',
apiKey: Platform.environment['VOLORIO_API_KEY']!,
);
final session = await volorio.createRoomSession(
const CreateVolorioRoomSessionInput(
clientId: 'app_...',
projectId: 'proj_...',
roomId: 'audio-party-123',
identity: 'user_123',
quality: VolorioMediaQuality.voice,
products: [
VolorioProductId.rtcVoice,
VolorioProductId.signaling,
VolorioProductId.chatMau,
],
),
);
Return the session JSON to your Flutter app. It contains a short-lived media token and heartbeat URL. It does not expose the Volorio API key.
Heartbeat and prepaid cutoff
final heartbeat = await volorio.heartbeat(session.sessionId);
if (heartbeat.status == 'ended') {
// Stop the participant locally.
}
Volorio captures participant-minute usage through heartbeat. If the account has
no free minutes and no wallet balance, the API returns 402 and the client
must disconnect.
Security checklist
- Store
apiKeyin your backend secret manager or environment. - Do not embed
apiKeyin Flutter, iOS, Android, web, or React Native apps. - Treat
clientIdandprojectIdas public routing identifiers. - Create separate API keys per environment and per product entitlement.