Search code examples
javascriptreactjspubnub

How to use pubnub to allow user to create a group chat


I'm trying to build a chat application using pubnub. One of the features i need is to enable individual user(s) to create a group chat where they can add/remove members and are also able to make a member admin. I've found solutions to pre-create a channel/space to which users can subscribe and publish. But i haven't found anything that fulfills my requirement.

Any help would be appreciated. Thanks in advance


Solution

  • In PubNub, group chats work very similar to 1-on-1 chats. The difference is in the implementation. For a 1-on-1 chat you will give permissions to subscribe from and publish messages to a channel only to 2 users, while for a group chat you will give the same permissions to all the members of a group.

    You can use PubNub Access Manager (PAM) on the server-side to give permissions to your users to be able to subscribe to (read from) and publish to (write to) different channels.

    You can grant 'manage' permission to a user to make them a pseudo-admin.

    For more details, feel free to email [email protected]