Overview
React Together provides a collection of utility functions through theutils
module to help you integrate collaboration features into your applications. These utilities handle common tasks like URL manipulation for session sharing, user identification, and styling.
Import Pattern
All utilities are available through theutils
export:
Available Utilities
URL Management
getJoinUrl
Create shareable URLs with embedded session parameters
getCleanUrl
Remove session parameters from URLs for clean navigation
getSessionNameFromUrl
Extract session names from URL query parameters
getSessionPasswordFromUrl
Extract session passwords from URL hash parameters
User Management
deriveNickname
Generate human-readable nicknames from user IDs
getUserColor
Generate consistent colors for users based on their IDs
Common Use Cases
Session Sharing Workflow
User Display Management
URL Cleanup
Integration Examples
Custom Session Manager
Build your own session management UI using the utilities:User Avatar System
Create a consistent user avatar system:Smart URL Router Integration
Integrate with React Router for automatic session joining:Best Practices
URL Parameter Security
Consistent User Colors
URL Management
Error Handling
The utility functions are designed to be safe and handle edge cases:TypeScript Support
All utilities are fully typed for better development experience:Related Documentation
- Session Management Hooks - Hooks that use these utilities internally
- SessionManager Component - Pre-built UI using these utilities
- ReactTogether Component - Main provider that handles URL parameters