Build real-time applications with PubNub pub/sub messaging
Agent Success
Agent success rate when using this tile
94%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.29x
Baseline
Agent success rate without this tile
73%
You are designing the channel structure for a PubNub-based messaging application. The app supports:
User IDs are alphanumeric strings like "user_abc123". The system will have thousands of users, and any two users should be able to start a private conversation.
Write a JavaScript utility module (channel-utils.js) that provides functions to generate channel names for each of the three channel types. Include documentation comments explaining the naming conventions and any constraints. Ensure the naming scheme works correctly regardless of which user initiates a private conversation.
channel-utils.js file with exported helper functions for generating channel names for private conversations, group chats, and user notification channels.