بهزودی. Abrova Chat بهزودی فعال میشود. این صفحه توضیح میدهد چطور کار خواهد کرد؛ هنوز قابل استفاده نیست.
این صفحه هنوز ترجمه نشده — نسخهی انگلیسی نمایش داده میشود. English
Core SDK API
Complete API reference for every method available on the Abrova Chat client — connection, rooms, messages, reactions, pins, subscriptions, presence, typing, unread, and event streams.
بهروزرسانی: ۵ آبان ۱۴۰۵
Complete API reference for every method available on the AbrovaChat client.
Full API Reference#
The full surface of AbrovaChatClient and the Node.js modular API, by platform.
Flutter
// AbrovaChatClient — Core SDK API final client = AbrovaChatClient(config); // Connection await client.connect(); await client.disconnect(); client.dispose(); // Rooms final rooms = await client.listRooms(); final room = await client.findOrCreateRoom(externalId: id, participants: participants); final roomById = await client.getRoom(roomId); // Messages final result = await client.getMessages(roomId, limit: 50); await client.sendMessage(roomId, content: 'Hello!'); await client.editMessage(messageId, content: 'Updated'); await client.deleteMessage(messageId); // Mark as read await client.markAsRead(roomId); // Reactions await client.addReaction(messageId, emoji: '👍'); await client.removeReaction(messageId, emoji: '👍'); // Room subscriptions (WebSocket) await client.subscribeRoom(roomId); await client.unsubscribeRoom(roomId); // Presence & Typing final onlineUsers = await client.getRoomPresence(roomId); await client.publishTyping(roomId); // Unread summary final summary = await client.getUnreadSummary(); // Event streams (for custom UI) client.onMessage // Stream<Message> client.onReadReceipt // Stream<ReadReceipt> client.onTypingEvent // Stream<TypingEvent> client.onPresenceChange // Stream<PresenceEvent> client.onReactionEvent // Stream<ReactionEvent> client.onMessageEdited // Stream<MessageEditEvent> client.onMessagePinChanged // Stream<MessagePinEvent> client.onConnectionStateChange // Stream<ConnectionState>
iOS
// AbrovaChatClient — Core SDK API let client = AbrovaChatClient(config: config) // Connection try await client.connect() client.disconnect() client.dispose() // Rooms let rooms = try await client.listRooms() let room = try await client.findOrCreateRoom(externalId: id, participants: participants) let roomById = try await client.getRoom(roomId) // Messages let result = try await client.getMessages(roomId, limit: 50) try await client.sendMessage(roomId, content: "Hello!") try await client.editMessage(messageId, content: "Updated") try await client.deleteMessage(messageId) // Mark as read try await client.markAsRead(roomId) // Reactions try await client.addReaction(messageId, emoji: "👍") try await client.removeReaction(messageId, emoji: "👍") // Room subscriptions (WebSocket) client.subscribeRoom(roomId) client.unsubscribeRoom(roomId) // Presence & Typing let onlineUsers = try await client.getRoomPresence(roomId) client.publishTyping(roomId) // Unread summary let summary = try await client.getUnreadSummary() // Combine publishers (for custom UI) client.onMessage // AnyPublisher<Message, Never> client.onReadReceipt // AnyPublisher<ReadReceipt, Never> client.onTypingEvent // AnyPublisher<TypingEvent, Never> client.onPresenceChange // AnyPublisher<PresenceEvent, Never> client.onReactionEvent // AnyPublisher<ReactionEvent, Never> client.onMessageEdited // AnyPublisher<MessageEditEvent, Never> client.onMessageDeleted // AnyPublisher<MessageDeletion, Never> client.onMessagePinChanged // AnyPublisher<MessagePinEvent, Never>
Android
// AbrovaChatClient — Core SDK API val client = AbrovaChatClient(config) // Connection client.connect() client.disconnect() client.dispose() // Rooms val rooms = client.listRooms() val room = client.findOrCreateRoom(externalId = id, participants = participants, metadata = metadata) val roomById = client.getRoom(roomId) // Messages val result = client.getMessages(roomId, limit = 50) client.sendMessage(roomId, content = "Hello!") client.editMessage(messageId, content = "Updated") client.deleteMessage(messageId) // Mark as read client.markAsRead(roomId) // Reactions client.addReaction(messageId, emoji = "👍") client.removeReaction(messageId, emoji = "👍") // Room subscriptions (WebSocket) client.subscribeRoom(roomId) client.unsubscribeRoom(roomId) // Presence & Typing val onlineUsers = client.getRoomPresence(roomId) client.publishTyping(roomId) // Unread summary val summary = client.getUnreadSummary() // Kotlin Flow streams (for custom UI) client.onMessage // SharedFlow<Message> client.onReadReceipt // SharedFlow<ReadReceipt> client.onTypingEvent // SharedFlow<TypingEvent> client.onPresenceChange // SharedFlow<PresenceEvent> client.onReactionEvent // SharedFlow<ReactionEvent> client.onMessageEdited // SharedFlow<MessageEditEvent> client.onMessageDeleted // SharedFlow<MessageDeletion> client.onMessagePinChanged // SharedFlow<MessagePinEvent>
React Native
// AbrovaChatClient — Core SDK API
const client = new AbrovaChatClient(config);
// Connection
client.connect();
client.disconnect();
client.dispose();
// Rooms
const rooms = await client.listRooms();
const room = await client.findOrCreateRoom(externalId, participants, metadata);
const roomById = await client.getRoom(roomId);
// Messages
const { messages } = await client.getMessages(roomId, { limit: 50 });
await client.sendMessage(roomId, 'Hello!');
await client.editMessage(roomId, messageId, 'Updated');
await client.deleteMessage(roomId, messageId);
// Mark as read
await client.markAsRead(roomId, messageId);
// Reactions
await client.addReaction(roomId, messageId, '👍');
await client.removeReaction(roomId, messageId, '👍');
// Pin / Unpin
await client.pinMessage(roomId, messageId);
await client.unpinMessage(roomId, messageId);
// Room subscriptions (WebSocket)
client.subscribeToRoom(roomId);
client.unsubscribeFromRoom(roomId);
// Presence & Typing
const onlineUsers = await client.getRoomPresence(roomId);
await client.publishTyping(roomId);
// Unread summary
const summary = await client.getUnreadSummary();
// Event listeners (for custom UI)
client.on('message', (event) => { /* MessageEvent: { message } */ });
client.on('readReceipt', (event) => { /* ReadReceiptEvent */ });
client.on('typing', (event) => { /* TypingEvent */ });
client.on('presence', (event) => { /* PresenceEvent */ });
client.on('reaction', (event) => { /* ReactionEvent */ });
client.on('messageEdited', (event) => { /* MessageEditEvent */ });
client.on('messageDeleted', (event) => { /* MessageDeletionEvent */ });
client.on('messagePinChanged', (event) => { /* MessagePinEvent */ });
client.on('authError', (event) => { /* AuthErrorEvent */ });Web
// AbrovaChatClient — Core SDK API
const client = new AbrovaChatClient(config);
// Connection
await client.connect();
client.disconnect();
client.dispose();
// Rooms
const rooms = await client.listRooms();
const room = await client.findOrCreateRoom({ externalId, participants, metadata });
const roomById = await client.getRoom(roomId);
// Messages
const { messages } = await client.getMessages(roomId, { limit: 50 });
await client.sendMessage(roomId, 'Hello!');
await client.editMessage(messageId, 'Updated');
await client.deleteMessage(messageId);
// Mark as read
await client.markAsRead(roomId);
// Reactions
await client.addReaction(messageId, '👍');
await client.removeReaction(messageId, '👍');
// Pin / Unpin
await client.pinMessage(messageId);
await client.unpinMessage(messageId);
// Room subscriptions (WebSocket)
client.subscribeToRoom(roomId);
client.unsubscribeFromRoom(roomId);
// Presence & Typing
const onlineUsers = await client.getRoomPresence(roomId);
await client.publishTyping(roomId);
// Unread summary
const summary = await client.getUnreadSummary();
// Event listeners (for custom UI)
client.on('message', (event) => { /* MessageEvent: { message } */ });
client.on('readReceipt', (event) => { /* ReadReceiptEvent */ });
client.on('typing', (event) => { /* TypingEvent */ });
client.on('presence', (event) => { /* PresenceEvent */ });
client.on('reaction', (event) => { /* ReactionEvent */ });
client.on('messageEdited', (event) => { /* MessageEditEvent */ });
client.on('messageDeleted', (event) => { /* MessageDeletionEvent */ });
client.on('messagePinChanged', (event) => { /* MessagePinEvent */ });
client.on('authError', (event) => { /* AuthErrorEvent */ });Node.js
// AbrovaChat Node.js SDK — Modular API
import { AbrovaChat } from '@abrova/chat';
const abrovaChat = new AbrovaChat({
apiKey: 'ab_live_your_api_key',
serverSecret: process.env.ABROVA_SERVER_SECRET,
});
// ─── abrovaChat.rooms ───
abrovaChat.rooms.create(options) // Create room
abrovaChat.rooms.findOrCreate(options) // Find or create by externalId → { room, created }
abrovaChat.rooms.get(roomId) // Get room by ID
abrovaChat.rooms.getByExternalId(externalId) // Get room by external ID
abrovaChat.rooms.list(userId) // List rooms for user
abrovaChat.rooms.addParticipant(roomId, options) // Add participant
abrovaChat.rooms.removeParticipant(roomId, externalUserId) // Remove participant
abrovaChat.rooms.delete(roomId) // Delete room
abrovaChat.rooms.getUnreadSummary(userId) // Unread counts
abrovaChat.rooms.getNotificationSettings(roomId, userId) // Per-room push settings
abrovaChat.rooms.updateNotificationSettings(roomId, userId, settings)
// ─── abrovaChat.messages ───
abrovaChat.messages.send(roomId, options) // Send message
abrovaChat.messages.getHistory(roomId, options) // Paginated history
abrovaChat.messages.markAsRead(roomId, userId) // Mark as read
abrovaChat.messages.edit(messageId, userId, content) // Edit message
abrovaChat.messages.delete(messageId, userId) // Delete message
abrovaChat.messages.search(roomId, options) // Search messages
abrovaChat.messages.getMentions(roomId, options) // Get @mentions
// ─── abrovaChat.reactions ───
abrovaChat.reactions.add(messageId, userId, emoji) // Add reaction
abrovaChat.reactions.remove(messageId, userId, emoji) // Remove reaction
abrovaChat.reactions.list(messageId) // List reactions
// ─── abrovaChat.pins ───
abrovaChat.pins.pin(messageId, userId) // Pin message
abrovaChat.pins.unpin(messageId, userId) // Unpin message
abrovaChat.pins.list(roomId) // List pinned messages
// ─── abrovaChat.webhooks ───
abrovaChat.webhooks.get() // Get config
abrovaChat.webhooks.setWebhook({ url, secret? }) // Set webhook
abrovaChat.webhooks.removeWebhook() // Remove webhook
abrovaChat.webhooks.setPushTemplate(templateId) // Set push template
abrovaChat.webhooks.removePushTemplate() // Remove push template
abrovaChat.webhooks.setPushTemplates(templates) // Per-event templates
abrovaChat.webhooks.removePushTemplates() // Remove per-event
// ─── abrovaChat.users ───
abrovaChat.users.createToken({ userId, info?, ttl? }) // User token for tokenProvider
abrovaChat.users.revokeTokens(userId) // Revoke all of a user's tokens
abrovaChat.users.getNotificationSettings(userId) // App-wide push settings
abrovaChat.users.updateNotificationSettings(userId, settings)
// ─── abrovaChat.tokens ───
abrovaChat.tokens.getConnectionToken({ userId, info? }) // Legacy connection token (prefer users.createToken)REST API
# AbrovaChatClient — REST API Endpoints
# Rooms
GET /api/v1/rooms?userId={userId} # List rooms
POST /api/v1/rooms/find-or-create # Find or create room
GET /api/v1/rooms/{roomId} # Get room
# Messages
GET /api/v1/rooms/{roomId}/messages?userId={userId} # Get messages
POST /api/v1/rooms/{roomId}/messages # Send message
PUT /api/v1/messages/{messageId} # Edit message
DELETE /api/v1/messages/{messageId}?userId={userId} # Delete message
# Mark as read
POST /api/v1/rooms/{roomId}/read # Mark as read
# Reactions
POST /api/v1/messages/{messageId}/reactions # Add reaction
DELETE /api/v1/messages/{messageId}/reactions # Remove reaction
# Presence (typing is published over the WebSocket, not REST)
GET /api/v1/rooms/{roomId}/presence # Get presence
# User tokens (server secret required)
POST /api/v1/users/token # Mint a user token (REST + WebSocket)
# Realtime (WebSocket): the client SDKs connect with the user token aboveاین صفحه مفید بود؟
گزارش مشکل