Skip to main content
The useJoinUrl hook returns the URL that other users can use to join the current React Together session. If there is no active session, this hook returns null. This hook is essential for sharing collaborative sessions and inviting others to join your workspace.

Basic Usage

Signature

Return Value

string | null
The join URL for the current session, or null if not connected to any session.

Examples

Simple Share Button

Create a basic share functionality with copy-to-clipboard:

Advanced Share Dialog

Create a comprehensive sharing interface with multiple sharing options:

QR Code Share

Generate a QR code for easy mobile sharing:

Session Info Panel

Display comprehensive session information including join URL:

Invitation Manager

Create a sophisticated invitation system:

Best Practices

URL Handling

  • Always check for null - The hook returns null when not in a session
  • Validate URLs - Ensure the URL is valid before sharing or processing
  • Handle URL parameters - Be aware of query parameters in the join URL

User Experience

  • Copy feedback - Provide clear feedback when URLs are copied
  • Share options - Offer multiple ways to share (copy, email, SMS, QR code)
  • Visual indicators - Show session status clearly

Security Considerations

  • URL sensitivity - Join URLs contain session credentials, handle them securely
  • Expiration awareness - URLs may become invalid when sessions end
  • Access control - Consider implementing additional access controls if needed

Common Patterns

Share Button with Copy

Email Invitation

URL Validation

TypeScript Support

This hook has simple, type-safe return value: