Skip to content

Realtime

Appwrite supports multiple protocols for accessing the server, including REST, GraphQL, and Realtime. The Appwrite Realtime allows you to listen to any Appwrite events in realtime using the Realtime service.

Instead of requesting new data via HTTP, the subscription will receive new data every time it changes, any connected client receives that update within milliseconds via a WebSocket connection.

This lets you build an interactive and responsive user experience by providing information from all of Appwrite's services in realtime. The example below shows subscribing to realtime events for file uploads.

To subscribe to updates from different Appwrite resources, you need to specify one or more channels. The channels offer a wide and powerful selection that will allow you to listen to all possible resources. This allows you to receive updates not only from the database, but from all the services that Appwrite offers.

If you subscribe to a channel, you will receive callbacks for a variety of events related to the channel. The events column in the callback can be used to filter and respond to specific events in a channel.

View a list of all available events.

Permissions

All subscriptions are secured by the permissions system offered by Appwrite, meaning a user will only receive updates to resources they have permission to access.

Using Role.any() on read permissions will allow any client to receive updates.

Limitations

While the Realtime API offers robust capabilities, there are currently some limitations to keep in mind.

Subscription changes

Client SDKs use a single WebSocket per Realtime client for all subscriptions. Adding a subscription with subscribe(), dropping one with subscription.unsubscribe(), or replacing channels and queries via subscription.update(...) applies on the existing socket where supported — no full reconnect required. The connection is torn down when you call realtime.disconnect(), or when the legacy subscription.close() runs on the last remaining subscription.

Manage subscription handles alongside your application state so you unsubscribe or disconnect when listeners are no longer needed. See Subscribe for platform-specific APIs.

Server SDKs

We currently are not offering access to realtime with Server SDKs and an API key.