From fb2bab03f76245251b82d4404bf48a6c7cd2ad94 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 23 Jan 2026 14:02:50 +0530 Subject: [PATCH 1/8] updated realtime doc --- src/routes/docs/apis/realtime/+page.markdoc | 321 +++++++++++++------- 1 file changed, 211 insertions(+), 110 deletions(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 86b52ed7d6..0fe2e8c596 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -12,14 +12,14 @@ This lets you build an interactive and responsive user experience by providing i {% multicode %} ```client-web -import { Client } from "appwrite"; +import { Client, Channel } from "appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); // Subscribe to files channel -client.subscribe('files', response => { +client.subscribe(Channel.bucket().file(), response => { if(response.events.includes('buckets.*.files.*.create')) { // Log when a new file is uploaded console.log(response.payload); @@ -37,7 +37,7 @@ final client = Client() final realtime = Realtime(client); // Subscribe to files channel -final subscription = realtime.subscribe(['files']); +final subscription = realtime.subscribe([Channel.bucket().file()]); subscription.stream.listen((response) { if(response.events.contains('buckets.*.files.*.create')) { @@ -58,8 +58,8 @@ let client = Client() let realtime = Realtime(client) // Subscribe to files channel -let subscription = realtime.subscribe(channels: ["files"]) { response in - if (response.events!.contains("buckets.*.files.*.create")) { +let subscription = realtime.subscribe(channels: [Channel.bucket().file()]) { response in + if (message.events!.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(String(describing: response)) } @@ -69,6 +69,7 @@ let subscription = realtime.subscribe(channels: ["files"]) { response in ```client-android-kotlin import io.appwrite.Client import io.appwrite.services.Realtime +import io.appwrite.extensions.Channel val client = Client(context) .setEndpoint("https://.cloud.appwrite.io/v1") @@ -77,7 +78,7 @@ val client = Client(context) val realtime = Realtime(client) // Subscribe to files channel -val subscription = realtime.subscribe("files") { +val subscription = realtime.subscribe(Channel.bucket().file()) { if(it.events.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(it.payload.toString()); @@ -89,10 +90,106 @@ val subscription = realtime.subscribe("files") { To subscribe to updates from different Appwrite resources, you need to specify one or more [channels](/docs/apis/realtime#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. +If you subscribe to a channel, you will receive callbacks for a variety of events related to the channel. The events attribute in the callback can be used to filter and respond to specific events in a channel. [View a list of all available events](/docs/advanced/platform/events). +## Channel helpers {% #channel-helpers %} + +Instead of manually writing channel strings, you can use the `Channel` helper class to build type-safe channel subscriptions. The helper provides a fluent API that makes it easier to construct channel strings and reduces errors. + +{% multicode %} +```client-web +import { Client, Channel } from "appwrite"; + +const client = new Client() + .setEndpoint('https://.cloud.appwrite.io/v1') + .setProject(''); + +// Subscribe to account channel +client.subscribe(Channel.account(), response => { + console.log(response); +}); + +// Subscribe to a specific row +client.subscribe( + Channel.tablesdb('db1').table('table1').row('row1'), + response => { + console.log(response); + } +); +``` + +```client-flutter +import 'package:appwrite/appwrite.dart'; + +final client = Client() + .setEndpoint('https://.cloud.appwrite.io/v1') + .setProject(''); + +final realtime = Realtime(client); + +// Subscribe to account channel +final subscription = realtime.subscribe([Channel.account()]); + +// Subscribe to a specific row +final docSubscription = realtime.subscribe([ + Channel.tablesdb('db1').table('table1').row('row1') +]); +``` + +```client-apple +import Appwrite + +let client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") + .setProject("") + +let realtime = Realtime(client) + +// Subscribe to account channel +let subscription = realtime.subscribe(channels: [Channel.account()]) { response in + print(String(describing: response)) +} + +// Subscribe to a specific row +let docSubscription = realtime.subscribe( + channels: [Channel.tablesdb("db1").table("table1").row("row1")] +) { response in + print(String(describing: response)) +} +``` + +```client-android-kotlin +import io.appwrite.Client +import io.appwrite.services.Realtime +import io.appwrite.extensions.Channel + +val client = Client(context) + .setEndpoint("https://.cloud.appwrite.io/v1") + .setProject("") + +val realtime = Realtime(client) + +// Subscribe to account channel +val subscription = realtime.subscribe(Channel.account()) { + print(it.toString()) +} + +// Subscribe to a specific row +val docSubscription = realtime.subscribe( + Channel.tablesdb("db1").table("table1").row("row1") +) { + print(it.toString()) +} +``` + +{% /multicode %} + +The `Channel` helper supports all available channels and allows you to: +- Build channels with a fluent, chainable API +- Optionally specify resource IDs (omit IDs to subscribe to all resources) +- Add event filters like `.create()`, `.update()`, or `.delete()` {% info title="Permissions" %} All subscriptions are secured by the [permissions system](/docs/advanced/platform/permissions) offered by Appwrite, meaning a user will only receive updates to resources they have permission to access. @@ -114,13 +211,13 @@ In this example we are subscribing to all updates related to our account by usin {% multicode %} ```client-web -import { Client } from "appwrite"; +import { Client, Channel } from "appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); -client.subscribe('account', response => { +client.subscribe(Channel.account(), response => { // Callback will be executed on all account events. console.log(response); }); @@ -135,7 +232,7 @@ final client = Client() final realtime = Realtime(client); -final subscription = realtime.subscribe(['account']); +final subscription = realtime.subscribe([Channel.account()]); subscription.stream.listen((response) { // Callback will be executed on all account events. @@ -153,7 +250,7 @@ let client = Client() let realtime = Realtime(client) -let subscription = realtime.subscribe(channel: "account") { response in +let subscription = realtime.subscribe(channels: [Channel.account()]) { response in // Callback will be executed on all account events. print(String(describing: response)) } @@ -162,6 +259,7 @@ let subscription = realtime.subscribe(channel: "account") { response in ```client-android-kotlin import io.appwrite.Client import io.appwrite.services.Realtime +import io.appwrite.extensions.Channel val client = Client(context) .setEndpoint("https://.cloud.appwrite.io/v1") @@ -169,7 +267,7 @@ val client = Client(context) val realtime = Realtime(client) -val subscription = realtime.subscribe("account") { +val subscription = realtime.subscribe(Channel.account()) { // Callback will be executed on all account events. print(it.payload.toString()) } @@ -181,18 +279,21 @@ val subscription = realtime.subscribe("account") { You can also listen to multiple channels at once by passing an array of channels. This will trigger the callback for any events for all channels passed. -In this example we are listening to a specific row and all files by subscribing to the `databases..tables..rows.` and `files` channels. +In this example we are listening to a specific row and all files by subscribing to multiple channels. {% multicode %} ```client-web -import { Client } from "appwrite"; +import { Client, Channel } from "appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); -client.subscribe(['databases..tables..rows.', 'files'], response => { - // Callback will be executed on changes for the specific row and all files. +client.subscribe([ + Channel.tablesdb('db1').table('table1').row('row1'), + Channel.bucket().file() +], response => { + // Callback will be executed on changes for the row and all files. console.log(response); }); ``` @@ -206,10 +307,13 @@ final client = Client() final realtime = Realtime(client); -final subscription = realtime.subscribe(['databases..tables..rows.', 'files']); +final subscription = realtime.subscribe([ + Channel.tablesdb('db1').table('table1').row('row1'), + Channel.bucket().file() +]); subscription.stream.listen((response) { - // Callback will be executed on changes for the specific row and all files. + // Callback will be executed on changes for the row and all files. print(response); }) ``` @@ -224,8 +328,11 @@ let client = Client() let realtime = Realtime(client) -realtime.subscribe(channels: ["databases..tables..rows.", "files"]) { response in - // Callback will be executed on changes for the specific row and all files. +realtime.subscribe(channels: [ + Channel.tablesdb("db1").table("table1").row("row1"), + Channel.bucket().file() +]) { response in + // Callback will be executed on changes for the row and all files. print(String(describing: response)) } ``` @@ -233,14 +340,18 @@ realtime.subscribe(channels: ["databases..tables..rows..cloud.appwrite.io/v1") .setProject("") val realtime = Realtime(client) -realtime.subscribe(listOf("databases..tables..rows.", "files")) { - // Callback will be executed on changes for the specific row and all files. +realtime.subscribe( + Channel.tablesdb("db1").table("table1").row("row1"), + Channel.bucket().file() +) { + // Callback will be executed on changes for the row and all files. print(it.toString()) } ``` @@ -253,13 +364,13 @@ If you no longer want to receive updates from a subscription, you can unsubscrib {% multicode %} ```client-web -import { Client } from "appwrite"; +import { Client, Channel } from "appwrite"; const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); -const unsubscribe = client.subscribe('files', response => { +const unsubscribe = client.subscribe(Channel.bucket().file(), response => { // Callback will be executed on changes for all files. console.log(response); }); @@ -277,7 +388,7 @@ final client = Client() final realtime = Realtime(client); -final subscription = realtime.subscribe(['files']); +final subscription = realtime.subscribe([Channel.bucket().file()]); subscription.stream.listen((response) { // Callback will be executed on changes for all files. @@ -294,7 +405,7 @@ import Appwrite let client = Client() let realtime = Realtime(client) -let subscription = realtime.subscribe(channel: "files") { response in +let subscription = realtime.subscribe(channels: [Channel.bucket().file()]) { response in // Callback will be executed on changes for all files. print(response.toString()) } @@ -306,6 +417,7 @@ subscription.close() ```client-android-kotlin import io.appwrite.Client import io.appwrite.services.Realtime +import io.appwrite.extensions.Channel val client = Client(context) .setEndpoint("https://.cloud.appwrite.io/v1") @@ -313,7 +425,7 @@ val client = Client(context) val realtime = Realtime(client) -val subscription = realtime.subscribe("files") { +val subscription = realtime.subscribe(Channel.bucket().file()) { // Callback will be executed on changes for all files. print(it.toString()) } @@ -350,40 +462,40 @@ The payload from the subscription will contain following properties: * Payload contains the data equal to the response model. {% /table %} -If you subscribe to the `rows` channel and a row the user is allowed to read is updated, you will receive an object containing information about the event and the updated row. +If you subscribe to the `documents` channel and a document the user is allowed to read is updated, you will receive an object containing information about the event and the updated document. The response will look like this: ```json { "events": [ - "databases.default.tables.sample.rows.63c98b9baea0938e1206.update", - "databases.*.tables.*.rows.*.update", - "databases.default.tables.*.rows.63c98b9baea0938e1206.update", - "databases.*.tables.*.rows.63c98b9baea0938e1206.update", - "databases.*.tables.sample.rows.63c98b9baea0938e1206.update", - "databases.default.tables.sample.rows.*.update", - "databases.*.tables.sample.rows.*.update", - "databases.default.tables.*.rows.*.update", - "databases.default.tables.sample.rows.63c98b9baea0938e1206", - "databases.*.tables.*.rows.*", - "databases.default.tables.*.rows.63c98b9baea0938e1206", - "databases.*.tables.*.rows.63c98b9baea0938e1206", - "databases.*.tables.sample.rows.63c98b9baea0938e1206", - "databases.default.tables.sample.rows.*", - "databases.*.tables.sample.rows.*", - "databases.default.tables.*.rows.*", - "databases.default.tables.sample", - "databases.*.tables.*", - "databases.default.tables.*", - "databases.*.tables.sample", + "databases.default.collections.sample.documents.63c98b9baea0938e1206.update", + "databases.*.collections.*.documents.*.update", + "databases.default.collections.*.documents.63c98b9baea0938e1206.update", + "databases.*.collections.*.documents.63c98b9baea0938e1206.update", + "databases.*.collections.sample.documents.63c98b9baea0938e1206.update", + "databases.default.collections.sample.documents.*.update", + "databases.*.collections.sample.documents.*.update", + "databases.default.collections.*.documents.*.update", + "databases.default.collections.sample.documents.63c98b9baea0938e1206", + "databases.*.collections.*.documents.*", + "databases.default.collections.*.documents.63c98b9baea0938e1206", + "databases.*.collections.*.documents.63c98b9baea0938e1206", + "databases.*.collections.sample.documents.63c98b9baea0938e1206", + "databases.default.collections.sample.documents.*", + "databases.*.collections.sample.documents.*", + "databases.default.collections.*.documents.*", + "databases.default.collections.sample", + "databases.*.collections.*", + "databases.default.collections.*", + "databases.*.collections.sample", "databases.default", "databases.*" ], "channels": [ - "rows", - "databases.default.tables.sample.rows", - "databases.default.tables.sample.rows.63c98b9baea0938e1206" + "documents", + "databases.default.collections.sample.documents", + "databases.default.collections.sample.documents.63c98b9baea0938e1206" ], "timestamp": "2023-01-19 18:30:04.051", "payload": { @@ -404,7 +516,7 @@ The response will look like this: "$createdAt": "2023-01-19T18:27:39.715+00:00", "$updatedAt": "2023-01-19T18:30:04.040+00:00", "$permissions": [], - "$tableId": "sample", + "$collectionId": "sample", "$databaseId": "default" } } @@ -412,89 +524,78 @@ The response will look like this: # Channels {% #channels %} -A list of channels you can subscribe to. Replace `` with your resource ID or use `*` for wildcards. - -## Account {% #account %} +A list of all channels available you can subscribe to. IDs cannot be wildcards. {% table %} * Channel +* Channel Helper * Description --- * `account` +* `Channel.account()` * All account related events (session create, name update...) - -{% /table %} - -## Databases {% #databases %} - -{% table %} -* Channel -* Description --- -* `rows` -* Any create/update/delete events to any row ---- -* `databases..tables..rows` +* `databases.[ID].collections.[ID].documents` +* `Channel.tablesdb(ID).table(ID).row()` * Any create/update/delete events to any row in a table --- -* `databases..tables..rows.` -* Any create/update/delete events to a given row -{% /table %} - -## Storage {% #storage %} - -{% table %} -* Channel -* Description +* `documents` +* `Channel.tablesdb().table().row()` +* Any create/update/delete events to any row +--- +* `databases.[ID].collections.[ID].documents.[ID]` +* `Channel.tablesdb(ID).table(ID).row(ID)` +* Any update/delete events to a given row --- * `files` +* `Channel.bucket().file()` * Any create/update/delete events to any file --- -* `buckets..files` -* Any create/update/delete events to any file of the given bucket +* `buckets.[ID].files.[ID]` +* `Channel.bucket(ID).file(ID)` +* Any update/delete events to a given file of the given bucket --- -* `buckets..files.` -* Any create/update/delete events to a given file of the given bucket - -{% /table %} - -## Functions {% #functions %} - -{% table %} -* Channel -* Description +* `buckets.[ID].files` +* `Channel.bucket(ID).file()` +* Any update/delete events to any file of the given bucket --- -* `executions` -* Any execution event +* `teams` +* `Channel.team()` +* Any create/update/delete events to a any team --- -* `executions.` -* Any execution event to a given execution +* `teams.[ID]` +* `Channel.team(ID)` +* Any update/delete events to a given team --- -* `functions.` -* Any execution event to a given function - -{% /table %} - -## Teams & Memberships {% #teams %} - -{% table %} -* Channel -* Description +* `memberships` +* `Channel.membership()` +* Any create/update/delete events to a any membership --- -* `teams` -* Any create/update/delete events to any team +* `memberships.[ID]` +* `Channel.membership(ID)` +* Any update/delete events to a given membership --- -* `teams.` -* Any create/update/delete events to a given team +* `executions` +* `Channel.function().execution()` +* Any update to executions --- -* `memberships` -* Any create/update/delete events to any membership +* `executions.[ID]` +* `Channel.function().execution(ID)` +* Any update to a given execution --- -* `memberships.` -* Any create/update/delete events to a given membership +* `functions.[ID]` +* `Channel.function(ID)` +* Any execution event to a given function {% /table %} +You can also filter events by appending event methods to the channel helpers: +- `.create()` - Listen only to create events +- `.update()` - Listen only to update events +- `.delete()` - Listen only to delete events + +For example, `Channel.tablesdb('db1').table('table1').row('row1').update().toString()` will only trigger on row updates. + # Custom endpoint {% #custom-endpoint %} The SDK will guess the endpoint of the Realtime API when setting the endpoint of your Appwrite instance. If you are running Appwrite with a custom proxy and changed the route of the Realtime API, you can call the `setEndpointRealtime` method on the Client SDK and set your new endpoint value. From 8a8278e493d0912899230cbf0e27c3788728f254 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 23 Jan 2026 14:04:16 +0530 Subject: [PATCH 2/8] typo --- src/routes/docs/apis/realtime/+page.markdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 0fe2e8c596..da4307d48b 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -561,7 +561,7 @@ A list of all channels available you can subscribe to. IDs cannot be wildcards. --- * `teams` * `Channel.team()` -* Any create/update/delete events to a any team +* Any create/update/delete events to any team --- * `teams.[ID]` * `Channel.team(ID)` @@ -569,7 +569,7 @@ A list of all channels available you can subscribe to. IDs cannot be wildcards. --- * `memberships` * `Channel.membership()` -* Any create/update/delete events to a any membership +* Any create/update/delete events to any membership --- * `memberships.[ID]` * `Channel.membership(ID)` From 532592daa68c64a4c75c24f902e3948ad29d0cea Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 29 Jan 2026 11:59:57 +0530 Subject: [PATCH 3/8] updated docs --- src/routes/docs/apis/realtime/+page.markdoc | 74 ++++++++++----------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index da4307d48b..19da310123 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -19,7 +19,7 @@ const client = new Client() .setProject(''); // Subscribe to files channel -client.subscribe(Channel.bucket().file(), response => { +client.subscribe(Channel.files, response => { if(response.events.includes('buckets.*.files.*.create')) { // Log when a new file is uploaded console.log(response.payload); @@ -37,7 +37,7 @@ final client = Client() final realtime = Realtime(client); // Subscribe to files channel -final subscription = realtime.subscribe([Channel.bucket().file()]); +final subscription = realtime.subscribe([Channel.files]); subscription.stream.listen((response) { if(response.events.contains('buckets.*.files.*.create')) { @@ -58,7 +58,7 @@ let client = Client() let realtime = Realtime(client) // Subscribe to files channel -let subscription = realtime.subscribe(channels: [Channel.bucket().file()]) { response in +let subscription = realtime.subscribe(channels: [Channel.files]) { response in if (message.events!.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(String(describing: response)) @@ -78,7 +78,7 @@ val client = Client(context) val realtime = Realtime(client) // Subscribe to files channel -val subscription = realtime.subscribe(Channel.bucket().file()) { +val subscription = realtime.subscribe(Channel.files) { if(it.events.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(it.payload.toString()); @@ -113,7 +113,7 @@ client.subscribe(Channel.account(), response => { // Subscribe to a specific row client.subscribe( - Channel.tablesdb('db1').table('table1').row('row1'), + Channel.tablesdb('').table('').row(''), response => { console.log(response); } @@ -134,7 +134,7 @@ final subscription = realtime.subscribe([Channel.account()]); // Subscribe to a specific row final docSubscription = realtime.subscribe([ - Channel.tablesdb('db1').table('table1').row('row1') + Channel.tablesdb('').table('').row('') ]); ``` @@ -154,7 +154,7 @@ let subscription = realtime.subscribe(channels: [Channel.account()]) { response // Subscribe to a specific row let docSubscription = realtime.subscribe( - channels: [Channel.tablesdb("db1").table("table1").row("row1")] + channels: [Channel.tablesdb("").table("").row("")] ) { response in print(String(describing: response)) } @@ -178,7 +178,7 @@ val subscription = realtime.subscribe(Channel.account()) { // Subscribe to a specific row val docSubscription = realtime.subscribe( - Channel.tablesdb("db1").table("table1").row("row1") + Channel.tablesdb("").table("").row("") ) { print(it.toString()) } @@ -290,8 +290,8 @@ const client = new Client() .setProject(''); client.subscribe([ - Channel.tablesdb('db1').table('table1').row('row1'), - Channel.bucket().file() + Channel.tablesdb('').table('').row(''), + Channel.files ], response => { // Callback will be executed on changes for the row and all files. console.log(response); @@ -308,8 +308,8 @@ final client = Client() final realtime = Realtime(client); final subscription = realtime.subscribe([ - Channel.tablesdb('db1').table('table1').row('row1'), - Channel.bucket().file() + Channel.tablesdb('').table('').row(''), + Channel.files ]); subscription.stream.listen((response) { @@ -329,8 +329,8 @@ let client = Client() let realtime = Realtime(client) realtime.subscribe(channels: [ - Channel.tablesdb("db1").table("table1").row("row1"), - Channel.bucket().file() + Channel.tablesdb("").table("").row(""), + Channel.files ]) { response in // Callback will be executed on changes for the row and all files. print(String(describing: response)) @@ -348,8 +348,8 @@ val client = Client(context) val realtime = Realtime(client) realtime.subscribe( - Channel.tablesdb("db1").table("table1").row("row1"), - Channel.bucket().file() + Channel.tablesdb("").table("").row(""), + Channel.files ) { // Callback will be executed on changes for the row and all files. print(it.toString()) @@ -370,7 +370,7 @@ const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); -const unsubscribe = client.subscribe(Channel.bucket().file(), response => { +const unsubscribe = client.subscribe(Channel.files, response => { // Callback will be executed on changes for all files. console.log(response); }); @@ -388,7 +388,7 @@ final client = Client() final realtime = Realtime(client); -final subscription = realtime.subscribe([Channel.bucket().file()]); +final subscription = realtime.subscribe([Channel.files]); subscription.stream.listen((response) { // Callback will be executed on changes for all files. @@ -405,7 +405,7 @@ import Appwrite let client = Client() let realtime = Realtime(client) -let subscription = realtime.subscribe(channels: [Channel.bucket().file()]) { response in +let subscription = realtime.subscribe(channels: [Channel.files]) { response in // Callback will be executed on changes for all files. print(response.toString()) } @@ -425,7 +425,7 @@ val client = Client(context) val realtime = Realtime(client) -val subscription = realtime.subscribe(Channel.bucket().file()) { +val subscription = realtime.subscribe(Channel.files) { // Callback will be executed on changes for all files. print(it.toString()) } @@ -462,7 +462,7 @@ The payload from the subscription will contain following properties: * Payload contains the data equal to the response model. {% /table %} -If you subscribe to the `documents` channel and a document the user is allowed to read is updated, you will receive an object containing information about the event and the updated document. +If you subscribe to the `rows` channel and a row the user is allowed to read is updated, you will receive an object containing information about the event and the updated row. The response will look like this: @@ -524,7 +524,7 @@ The response will look like this: # Channels {% #channels %} -A list of all channels available you can subscribe to. IDs cannot be wildcards. +A list of all channels available you can subscribe to. When using `Channel` helpers, leaving an ID blank will subscribe using `*`. {% table %} * Channel @@ -536,55 +536,55 @@ A list of all channels available you can subscribe to. IDs cannot be wildcards. * All account related events (session create, name update...) --- * `databases.[ID].collections.[ID].documents` -* `Channel.tablesdb(ID).table(ID).row()` +* `Channel.tablesdb('').table('').row()` * Any create/update/delete events to any row in a table --- -* `documents` -* `Channel.tablesdb().table().row()` +* `rows` +* `Channel.rows` * Any create/update/delete events to any row --- * `databases.[ID].collections.[ID].documents.[ID]` -* `Channel.tablesdb(ID).table(ID).row(ID)` +* `Channel.tablesdb('').table('').row('')` * Any update/delete events to a given row --- * `files` -* `Channel.bucket().file()` +* `Channel.files` * Any create/update/delete events to any file --- * `buckets.[ID].files.[ID]` -* `Channel.bucket(ID).file(ID)` +* `Channel.bucket('').file('')` * Any update/delete events to a given file of the given bucket --- * `buckets.[ID].files` -* `Channel.bucket(ID).file()` +* `Channel.bucket('').file()` * Any update/delete events to any file of the given bucket --- -* `teams` +* `teams.*` * `Channel.team()` * Any create/update/delete events to any team --- * `teams.[ID]` -* `Channel.team(ID)` +* `Channel.team('')` * Any update/delete events to a given team --- -* `memberships` +* `memberships.*` * `Channel.membership()` * Any create/update/delete events to any membership --- * `memberships.[ID]` -* `Channel.membership(ID)` +* `Channel.membership('')` * Any update/delete events to a given membership --- * `executions` -* `Channel.function().execution()` +* `Channel.executions` * Any update to executions --- * `executions.[ID]` -* `Channel.function().execution(ID)` +* `Channel.function().execution('')` * Any update to a given execution --- * `functions.[ID]` -* `Channel.function(ID)` +* `Channel.function('')` * Any execution event to a given function {% /table %} @@ -594,7 +594,7 @@ You can also filter events by appending event methods to the channel helpers: - `.update()` - Listen only to update events - `.delete()` - Listen only to delete events -For example, `Channel.tablesdb('db1').table('table1').row('row1').update().toString()` will only trigger on row updates. +For example, `Channel.tablesdb('').table('').row('').update()` will only trigger on row updates. # Custom endpoint {% #custom-endpoint %} From 6eae2c28c7522201c0551dc2bdf5ae8f90825ac5 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 29 Jan 2026 12:12:45 +0530 Subject: [PATCH 4/8] fixes --- src/routes/docs/apis/realtime/+page.markdoc | 68 ++++++++++----------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 19da310123..2decd848df 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -90,7 +90,7 @@ val subscription = realtime.subscribe(Channel.files) { To subscribe to updates from different Appwrite resources, you need to specify one or more [channels](/docs/apis/realtime#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 attribute in the callback can be used to filter and respond to specific events in a channel. +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](/docs/advanced/platform/events). @@ -279,7 +279,7 @@ val subscription = realtime.subscribe(Channel.account()) { You can also listen to multiple channels at once by passing an array of channels. This will trigger the callback for any events for all channels passed. -In this example we are listening to a specific row and all files by subscribing to multiple channels. +In this example we are listening to a specific row and all files by subscribing to `Channel.tablesdb("").table("").row("")` and `Channel.files` channels. {% multicode %} ```client-web @@ -469,33 +469,33 @@ The response will look like this: ```json { "events": [ - "databases.default.collections.sample.documents.63c98b9baea0938e1206.update", - "databases.*.collections.*.documents.*.update", - "databases.default.collections.*.documents.63c98b9baea0938e1206.update", - "databases.*.collections.*.documents.63c98b9baea0938e1206.update", - "databases.*.collections.sample.documents.63c98b9baea0938e1206.update", - "databases.default.collections.sample.documents.*.update", - "databases.*.collections.sample.documents.*.update", - "databases.default.collections.*.documents.*.update", - "databases.default.collections.sample.documents.63c98b9baea0938e1206", - "databases.*.collections.*.documents.*", - "databases.default.collections.*.documents.63c98b9baea0938e1206", - "databases.*.collections.*.documents.63c98b9baea0938e1206", - "databases.*.collections.sample.documents.63c98b9baea0938e1206", - "databases.default.collections.sample.documents.*", - "databases.*.collections.sample.documents.*", - "databases.default.collections.*.documents.*", - "databases.default.collections.sample", - "databases.*.collections.*", - "databases.default.collections.*", - "databases.*.collections.sample", + "databases.default.tables.sample.rows.63c98b9baea0938e1206.update", + "databases.*.tables.*.rows.*.update", + "databases.default.tables.*.rows.63c98b9baea0938e1206.update", + "databases.*.tables.*.rows.63c98b9baea0938e1206.update", + "databases.*.tables.sample.rows.63c98b9baea0938e1206.update", + "databases.default.tables.sample.rows.*.update", + "databases.*.tables.sample.rows.*.update", + "databases.default.tables.*.rows.*.update", + "databases.default.tables.sample.rows.63c98b9baea0938e1206", + "databases.*.tables.*.rows.*", + "databases.default.tables.*.rows.63c98b9baea0938e1206", + "databases.*.tables.*.rows.63c98b9baea0938e1206", + "databases.*.tables.sample.rows.63c98b9baea0938e1206", + "databases.default.tables.sample.rows.*", + "databases.*.tables.sample.rows.*", + "databases.default.tables.*.rows.*", + "databases.default.tables.sample", + "databases.*.tables.*", + "databases.default.tables.*", + "databases.*.tables.sample", "databases.default", "databases.*" ], "channels": [ - "documents", - "databases.default.collections.sample.documents", - "databases.default.collections.sample.documents.63c98b9baea0938e1206" + "rows", + "databases.default.tables.sample.rows", + "databases.default.tables.sample.rows.63c98b9baea0938e1206" ], "timestamp": "2023-01-19 18:30:04.051", "payload": { @@ -516,7 +516,7 @@ The response will look like this: "$createdAt": "2023-01-19T18:27:39.715+00:00", "$updatedAt": "2023-01-19T18:30:04.040+00:00", "$permissions": [], - "$collectionId": "sample", + "$tableId": "sample", "$databaseId": "default" } } @@ -535,7 +535,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.account()` * All account related events (session create, name update...) --- -* `databases.[ID].collections.[ID].documents` +* `databases..collections..documents` * `Channel.tablesdb('').table('').row()` * Any create/update/delete events to any row in a table --- @@ -543,7 +543,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.rows` * Any create/update/delete events to any row --- -* `databases.[ID].collections.[ID].documents.[ID]` +* `databases..collections..documents.` * `Channel.tablesdb('').table('').row('')` * Any update/delete events to a given row --- @@ -551,11 +551,11 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.files` * Any create/update/delete events to any file --- -* `buckets.[ID].files.[ID]` +* `buckets..files.` * `Channel.bucket('').file('')` * Any update/delete events to a given file of the given bucket --- -* `buckets.[ID].files` +* `buckets..files` * `Channel.bucket('').file()` * Any update/delete events to any file of the given bucket --- @@ -563,7 +563,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.team()` * Any create/update/delete events to any team --- -* `teams.[ID]` +* `teams.` * `Channel.team('')` * Any update/delete events to a given team --- @@ -571,7 +571,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.membership()` * Any create/update/delete events to any membership --- -* `memberships.[ID]` +* `memberships.` * `Channel.membership('')` * Any update/delete events to a given membership --- @@ -579,11 +579,11 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.executions` * Any update to executions --- -* `executions.[ID]` +* `executions.` * `Channel.function().execution('')` * Any update to a given execution --- -* `functions.[ID]` +* `functions.` * `Channel.function('')` * Any execution event to a given function From c69aebc4882d842029623a149adc6b126752d18d Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 29 Jan 2026 13:45:40 +0530 Subject: [PATCH 5/8] changed the method names --- src/routes/docs/apis/realtime/+page.markdoc | 36 ++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 2decd848df..93121f7eb2 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -19,7 +19,7 @@ const client = new Client() .setProject(''); // Subscribe to files channel -client.subscribe(Channel.files, response => { +client.subscribe(Channel.files(), response => { if(response.events.includes('buckets.*.files.*.create')) { // Log when a new file is uploaded console.log(response.payload); @@ -37,7 +37,7 @@ final client = Client() final realtime = Realtime(client); // Subscribe to files channel -final subscription = realtime.subscribe([Channel.files]); +final subscription = realtime.subscribe([Channel.files()]); subscription.stream.listen((response) { if(response.events.contains('buckets.*.files.*.create')) { @@ -58,7 +58,7 @@ let client = Client() let realtime = Realtime(client) // Subscribe to files channel -let subscription = realtime.subscribe(channels: [Channel.files]) { response in +let subscription = realtime.subscribe(channels: [Channel.files()]) { response in if (message.events!.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(String(describing: response)) @@ -78,7 +78,7 @@ val client = Client(context) val realtime = Realtime(client) // Subscribe to files channel -val subscription = realtime.subscribe(Channel.files) { +val subscription = realtime.subscribe(Channel.files()) { if(it.events.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(it.payload.toString()); @@ -279,7 +279,7 @@ val subscription = realtime.subscribe(Channel.account()) { You can also listen to multiple channels at once by passing an array of channels. This will trigger the callback for any events for all channels passed. -In this example we are listening to a specific row and all files by subscribing to `Channel.tablesdb("").table("").row("")` and `Channel.files` channels. +In this example we are listening to a specific row and all files by subscribing to `Channel.tablesdb("").table("").row("")` and `Channel.files()` channels. {% multicode %} ```client-web @@ -291,7 +291,7 @@ const client = new Client() client.subscribe([ Channel.tablesdb('').table('').row(''), - Channel.files + Channel.files() ], response => { // Callback will be executed on changes for the row and all files. console.log(response); @@ -309,7 +309,7 @@ final realtime = Realtime(client); final subscription = realtime.subscribe([ Channel.tablesdb('').table('').row(''), - Channel.files + Channel.files() ]); subscription.stream.listen((response) { @@ -330,7 +330,7 @@ let realtime = Realtime(client) realtime.subscribe(channels: [ Channel.tablesdb("").table("").row(""), - Channel.files + Channel.files() ]) { response in // Callback will be executed on changes for the row and all files. print(String(describing: response)) @@ -349,7 +349,7 @@ val realtime = Realtime(client) realtime.subscribe( Channel.tablesdb("").table("").row(""), - Channel.files + Channel.files() ) { // Callback will be executed on changes for the row and all files. print(it.toString()) @@ -370,7 +370,7 @@ const client = new Client() .setEndpoint('https://.cloud.appwrite.io/v1') .setProject(''); -const unsubscribe = client.subscribe(Channel.files, response => { +const unsubscribe = client.subscribe(Channel.files(), response => { // Callback will be executed on changes for all files. console.log(response); }); @@ -388,7 +388,7 @@ final client = Client() final realtime = Realtime(client); -final subscription = realtime.subscribe([Channel.files]); +final subscription = realtime.subscribe([Channel.files()]); subscription.stream.listen((response) { // Callback will be executed on changes for all files. @@ -405,7 +405,7 @@ import Appwrite let client = Client() let realtime = Realtime(client) -let subscription = realtime.subscribe(channels: [Channel.files]) { response in +let subscription = realtime.subscribe(channels: [Channel.files()]) { response in // Callback will be executed on changes for all files. print(response.toString()) } @@ -425,7 +425,7 @@ val client = Client(context) val realtime = Realtime(client) -val subscription = realtime.subscribe(Channel.files) { +val subscription = realtime.subscribe(Channel.files()) { // Callback will be executed on changes for all files. print(it.toString()) } @@ -540,7 +540,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * Any create/update/delete events to any row in a table --- * `rows` -* `Channel.rows` +* `Channel.rows()` * Any create/update/delete events to any row --- * `databases..collections..documents.` @@ -548,7 +548,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * Any update/delete events to a given row --- * `files` -* `Channel.files` +* `Channel.files()` * Any create/update/delete events to any file --- * `buckets..files.` @@ -560,11 +560,11 @@ A list of all channels available you can subscribe to. When using `Channel` help * Any update/delete events to any file of the given bucket --- * `teams.*` -* `Channel.team()` +* `Channel.teams()()` * Any create/update/delete events to any team --- * `teams.` -* `Channel.team('')` +* `Channel.teams()('')` * Any update/delete events to a given team --- * `memberships.*` @@ -576,7 +576,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * Any update/delete events to a given membership --- * `executions` -* `Channel.executions` +* `Channel.executions()` * Any update to executions --- * `executions.` From a8bfb148943f39ac6f372fddb701d30d7553367e Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 29 Jan 2026 14:06:35 +0530 Subject: [PATCH 6/8] updated --- src/routes/docs/apis/realtime/+page.markdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 93121f7eb2..bd1217f4a2 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -560,7 +560,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * Any update/delete events to any file of the given bucket --- * `teams.*` -* `Channel.teams()()` +* `Channel.teams()` * Any create/update/delete events to any team --- * `teams.` From 6679978653685e3147852e1e71cc04c64c558d14 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 29 Jan 2026 14:15:41 +0530 Subject: [PATCH 7/8] updated --- src/routes/docs/apis/realtime/+page.markdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index bd1217f4a2..60a61a9c84 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -535,7 +535,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.account()` * All account related events (session create, name update...) --- -* `databases..collections..documents` +* `tablesdb..tables..rows` * `Channel.tablesdb('').table('').row()` * Any create/update/delete events to any row in a table --- @@ -543,7 +543,7 @@ A list of all channels available you can subscribe to. When using `Channel` help * `Channel.rows()` * Any create/update/delete events to any row --- -* `databases..collections..documents.` +* `tablesdb..tables..rows.` * `Channel.tablesdb('').table('').row('')` * Any update/delete events to a given row --- From 971db1b6a6cc6a75625c0179a11e6becbcffe065 Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Thu, 29 Jan 2026 16:49:56 +0530 Subject: [PATCH 8/8] updated --- src/routes/docs/apis/realtime/+page.markdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/docs/apis/realtime/+page.markdoc b/src/routes/docs/apis/realtime/+page.markdoc index 60a61a9c84..1abc7792ab 100644 --- a/src/routes/docs/apis/realtime/+page.markdoc +++ b/src/routes/docs/apis/realtime/+page.markdoc @@ -59,7 +59,7 @@ let realtime = Realtime(client) // Subscribe to files channel let subscription = realtime.subscribe(channels: [Channel.files()]) { response in - if (message.events!.contains("buckets.*.files.*.create")) { + if (response.events!.contains("buckets.*.files.*.create")) { // Log when a new file is uploaded print(String(describing: response)) }