paanj_client 0.0.1
paanj_client: ^0.0.1 copied to clipboard
Core client SDK for Paanj platform. Provides authentication, connection management, and base infrastructure.
Paanj Client SDK #
Core client SDK for the Paanj platform. This package provides authentication, connection management, and base infrastructure for feature packages like paanj_chat_client.
Features #
- Authentication: Anonymous and token-based authentication.
- Connection Management: WebSocket connection with automatic reconnection, backoff, and jitter.
- HTTP Client: Authenticated HTTP requests with automatic token refresh.
- Event System: Real-time event dispatching.
Getting Started #
Add paanj_client to your pubspec.yaml:
dependencies:
paanj_client: ^0.0.1
Usage #
import 'package:paanj_client/paanj_client.dart';
void main() async {
// Initialize client
final client = PaanjClient('your-api-key');
// Authenticate
await client.authenticateAnonymous({'name': 'Flutter User'});
// Connect to WebSocket
await client.connect();
// Listen for events
client.on('user.created', (data) {
print('User created: $data');
});
}