Core State Hooks
The foundation of collaborative React applications - these hooks handle shared state synchronization:useStateTogether
Works like useState but keeps all users in sync
useStateTogetherWithPerUserValues
Shared state with individual per-user values
useFunctionTogether
Execute functions across all connected users
Connection & Session Hooks
Manage user connections and session state:useIsTogether
Check if currently in a collaborative session
useIsSynchronized
Check if local state is synchronized with other users
useConnectedUsers
Get list of all connected users
useMyId
Get current user’s unique identifier
Session Management Hooks
Create, join, and leave collaborative sessions:useCreateRandomSession
Create sessions with randomly generated IDs
useJoinUrl
Generate shareable URLs for session joining
useLeaveSession
Programmatically leave the current session
Communication Hooks
Enable real-time communication between users:useChat
Add chat functionality to your app
useCursors
Show real-time cursor positions
useHoveringUsers
Track which users are hovering over elements
Utility Hooks
Helper hooks for common patterns and data access:useNicknames
Get human-readable nicknames for users
useAllNicknames
Access nicknames of all users in session
Hook Categories
By Use Case
Building Shared State
Building Shared State
Session Management
Session Management
Creation:
Sharing:
Leaving:
useCreateRandomSession
Sharing:
useJoinUrl
Leaving:
useLeaveSession
User Awareness
User Awareness
Connection Status:
User Information:
useIsTogether
, useIsSynchronized
User Information:
useConnectedUsers
, useMyId
, useNicknames
Real-time Features
Real-time Features
Communication:
Interaction:
useChat
Interaction:
useCursors
, useHoveringUsers
By Complexity Level
Beginner-Friendly
Beginner-Friendly
Start with these hooks for basic collaborative features:
useStateTogether
- Shared stateuseConnectedUsers
- See who’s onlineuseChat
- Add messaging
Intermediate
Intermediate
Add these for more sophisticated collaboration:
useStateTogetherWithPerUserValues
- Personal preferencesuseCursors
- Show user activityuseJoinUrl
- Session sharing
Advanced
Advanced
These hooks enable complex collaborative patterns:
useFunctionTogether
- Synchronized actionsuseHoveringUsers
- Fine-grained interaction trackinguseIsSynchronized
- Connection state management