paanj_chat_client 0.0.2 copy "paanj_chat_client: ^0.0.2" to clipboard
paanj_chat_client: ^0.0.2 copied to clipboard

Chat Client SDK for Paanj platform. Provides real-time messaging, conversation management, and user presence.

Paanj Chat Client SDK #

Chat Client SDK for the Paanj platform. This package builds on paanj_client to provide real-time messaging, conversation management, and user presence features.

Features #

  • Conversations: Create, list, join, and leave conversations.
  • Messages: Send and receive real-time messages.
  • Users: Manage user presence and blocked users.
  • Contexts: Fluent APIs for easier interaction with conversations and users.

Getting Started #

Add paanj_chat_client to your pubspec.yaml:

dependencies:
  paanj_chat_client: ^0.0.1

Usage #

import 'package:paanj_client/paanj_client.dart';
import 'package:paanj_chat_client/paanj_chat_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();

  // Initialize Chat Client
  final chat = ChatClient(client);

  // Listen for new messages globally
  chat.onMessage((message) {
    print('New message: ${message['content']}');
  });

  // Create a conversation
  final conversation = await chat.createConversation(CreateConversationData(
    name: 'Flutter Chat',
    participants: [ConversationMember(userId: '123')],
  ));

  // Send a message
  await chat.conversation(conversation.id).send('Hello from Flutter!');
}
0
likes
140
points
16
downloads

Documentation

API reference

Publisher

verified publisherpaanj.com

Weekly Downloads

Chat Client SDK for Paanj platform. Provides real-time messaging, conversation management, and user presence.

Homepage
Repository (GitHub)
View/report issues

Topics

#chat #sdk #messaging #realtime #websocket

License

MIT (license)

Dependencies

flutter, paanj_client

More

Packages that depend on paanj_chat_client