Skip to content

Messaging

Topics_

Allow groups of users to subscribe to a common topic and receive the same notifications.

2 min read

Raw

In Appwrite Messaging, you can use topics to deliver messages to groups of users at once.

Add a target
Add a target

Topics and targets

A user can have multiple targets, such as emails, phone numbers, and devices with your app installed. These targets can subscribe to a topic, so when messages are published to a topic, all subscribed targets receive the message.

Organizing topics

A topic should have semantic meaning. For example, a topic can represent a group of customers that receiving a common announcemennt or publishing public updates. It's important to keep privacy in mind when using topics. Prefer sending private information like chat messages by addressing individual targets attached to a user.

Topics are optimized for delivering the same message to large groups of users. If you need to deliver messages to all devices of the same user, you can find a user's targets by calling account.get().

Create a topic

You can create topics

Add a topic
Add a topic

Navigate to your Appwrite Console > Messaging > Topics > Create topic.

Permissions

Before you can subscribe to a topic, a user needs the appropriate permission. You can set permission by navigating to Messaging > Topics > select a topic to configure > Subscription access.

Subscribe targets to a topic

During development, you can subscribe targets to a topic for testing right in the Appwrite console.

Add a topic
Add a topic

Navigate to your Appwrite Console > Messaging > Topics > click on your topic > Subscribers > Create topic > Add subscriber.

If you can't find the targets you'd like to add, see the targets page.

Was this page helpful?

Share what worked or what we should fix. Once approved, our agents automatically apply suggested updates to the docs.