Token Gating Chat

Token gating chats allows CMS operators to control which users can enter a chat based on specific criteria, such as Contract wallet address. The CMS operator can turn on the token gating at the creation of a new chat or when modifying chat room details. Gates can also be turned off in the same fashion. The default setting for chat rooms is token gating off.

class SomeClass {
  let sdk: EngagementSDK
  func someMethod(){
    sdk.getChatRoomInfo(roomID: "<chat room id>") { result in
      switch result {
      case let .success(chatInfo):
          chatInfo.tokenGates.forEach { tokenGate in
            print("Contract Address: \(tokenGate.contractAddress)")
      case let .failure(error):
          print("Error: \(error.localizedDescription)")
//Get ChatRoom with token_gates
LiveLike.getChatRoom({ roomId }).then((chatRoomPayload) => {
    console.log("chatroom token_gates info", chatRoomPayload.token_gates);

//Add Listener to *chatroom-updated* event
    { roomId }

//Remove listener to *chatroom-updated* event
    { roomId }



What does gating a chat mean?

When an operator puts a gate on the chat, it means that only people with certain criteria can enter the chat room. The current accepted criteria is contract wallet address from NFTs.

Why use a token gate?

Token gating a chat with an NFT allows certain users to enter a room because they have the proper contract wallet address. Users with this criteria can have access to otherwise private chat rooms. Adding a gate to a chat room allows for operators to determine who can be in the chat room or not. Based on implementation, you have the option to remove previous users or not if you add a gate to an already existing chat room. In the same sense, if you remove a gate from a chat the integrator has the control over if the chat history remains or is erased due to being previously gated.

Sample use cases*

*These are just a few examples
NFTs can be created and given for any reason. Therefore, their use to gate chats can be for a variety of reasons.
For example, NFTs given to people in a specific location (like a field or arena) can enter a private chat together and discuss what is happening live.
NFTs can be given to different wallet addresses for social media giveaways, such as a private chat with an athlete.
Clients can partner with third party NFT distributors to create token chats based on points, features etc.