Hey Ayoub!

In terms of security, it can be set in the Firestore Rules and you can customize it so chats are only accessible by users that are a part of the conversation.

Firestore Rules allow you to place conditional access based on the document values. The messaging documents have `userId` and you can check that with the `id` of the user accessing the document to determine whether they should have access or not.

I hope that clears up your question!