restream library
A Dart library for interacting with the Restream.io REST API and WebSocket APIs.
This library provides a complete interface to the Restream.io platform, including OAuth2 authentication, REST API endpoints, and real-time WebSocket monitoring capabilities. It's designed to be easily integrated into Flutter applications.
Features:
- OAuth2 authentication flow optimized for mobile apps
- Complete REST API coverage (profiles, channels, events, stream keys)
- WebSocket support for real-time streaming and chat monitoring
- Proper error handling and type safety
- Flutter-friendly async/await patterns
Example usage:
import 'package:restream/restream.dart';
// Initialize client
final client = RestreamClient();
// Authenticate (handle OAuth flow)
await client.authenticate();
// Use API endpoints
final profile = await client.getProfile();
final events = await client.listEvents();
Classes
- Channel
- Channel information for streaming platforms.
- ChannelMeta
- Channel metadata information.
- ChatEvent
- Chat event data from WebSocket.
- ChatMessage
- Chat message data extracted from chat events.
- ChatMonitor
- WebSocket monitor for real-time chat events.
- EventDestination
- Event destination information representing where a stream is broadcast.
- FileTokenStorage
- File-based token storage for standalone Dart applications.
- MemoryTokenStorage
- In-memory token storage (for testing or temporary usage).
- OAuthFlow
- OAuth2 flow implementation for Restream.io authentication.
- PkceParameters
- PKCE (Proof Key for Code Exchange) parameters.
- Platform
- Streaming platform information from /platform/all endpoint.
- PlatformImage
- Platform image URLs.
- Profile
- User profile information from the /profile endpoint.
- RestreamClient
- Main client for interacting with the Restream.io API.
- RestreamConfig
- Configuration class for Restream.io client settings.
- Server
- Ingest server information from /server/all endpoint.
- StreamEvent
- Stream event information representing a streaming session.
- StreamingEvent
- Streaming event data from WebSocket.
- StreamingMonitor
- WebSocket monitor for real-time streaming events.
- StreamKey
- Stream key information for RTMP streaming.
- TokenInfo
- Token information extracted from stored tokens.
- TokenStorage
- Token storage interface for OAuth tokens.
Enums
- ChatEventType
- Event types for chat monitoring.
- StreamingEventType
- Event types for streaming monitoring.
Exceptions / Errors
- ApiException
- Exception raised when API requests fail.
- AuthenticationException
- Exception raised when OAuth authentication fails.
- NetworkException
- Exception raised when network operations fail.
- RestreamException
- Base exception for all Restream.io API errors.
- WebSocketException
- Exception raised when WebSocket operations fail.