Skip to main content

Overview

social.plus SDK provides a powerful real-time event system that keeps your application synchronized with live data changes. When users modify profiles, create posts, send messages, or perform other actions, these changes are instantly reflected across all connected devices.
Real-time events work seamlessly with Live Objects & Collections to provide automatic UI updates without manual data fetching.

Supported Data Models

Social Features

Communities, Posts, Comments, User profiles, Follow relationships

Chat Features

Channels, Subchannels, Messages, Member activities

Event Types by Model

ModelAvailable Events
CommunityCreated, Updated, Deleted, Joined, Left, Member management
PostCreated, Updated, Deleted, Approved, Flagged, Reactions
CommentCreated, Updated, Deleted, Flagged, Reactions
UserProfile updates, Follow/Unfollow activities
ChannelMessages, Member activities, Status changes
SubchannelThread-specific updates

How It Works

1. Subscription Topics

Create subscription topics to define which events you want to receive:

2. Event Delivery

Events are delivered through Live Objects and Collections that you’re already observing:
  • Automatic Updates: No manual refresh needed
  • Real-time Synchronization: Changes appear instantly
  • Efficient: Only subscribed events are processed

Managing Subscriptions

Subscription Limits

The SDK has a maximum limit of 20 active subscriptions per session. Manage your subscriptions carefully to stay within this limit.

Best Practices for Subscription Management

Instead of subscribing to individual posts or comments, subscribe to community-level topics with POST_AND_COMMENT level to cover all content in that community.
// ✅ Better: One subscription covers all posts and comments
const topic = getCommunityTopic(community, SubscriptionLevels.POST_AND_COMMENT);

// ❌ Avoid: Multiple subscriptions for the same data
const postTopic = getPostTopic(post1, SubscriptionLevels.POST);
const commentTopic = getPostTopic(post1, SubscriptionLevels.COMMENT);
Manage subscriptions based on UI state to optimize performance and stay within limits.
// React example
useEffect(() => {
  const topic = getCommunityTopic(community, SubscriptionLevels.POST);
  
  // Subscribe when component mounts
  EventSubscriberRepository.subscribe(topic);
  
  return () => {
    // Unsubscribe when component unmounts
    EventSubscriberRepository.unsubscribe(topic);
  };
}, [community.communityId]);
All subscriptions are automatically removed when logout() is called, helping prevent memory leaks and unwanted data consumption.

Next Steps