Need to add the apiRequest for addChat on the client side to start a chat with a user if it hasn't been done previously. Then, either initiate a chat or check if a chat already exists, and decide whether to create a new chat or continue with the existing one.

Check this image can create a handler to initiate a chat for the first time
Need to add the apiRequest for addChat on the client side to start a chat with a user if it hasn't been done previously. Then, either initiate a chat or check if a chat already exists, and decide whether to create a new chat or continue with the existing one.
Check this image can create a handler to initiate a chat for the first time