Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

updates the blog post witht the latest realtime updates

Copple7222f311bb71
diff --git a/apps/www/_blog/2022-08-16-supabase-js-v2.mdx b/apps/www/_blog/2022-08-16-supabase-js-v2.mdx
index f97b1f294c6..0b6496b50c5 100644
--- a/apps/www/_blog/2022-08-16-supabase-js-v2.mdx
+++ b/apps/www/_blog/2022-08-16-supabase-js-v2.mdx
@@ -120,9 +120,21 @@ Previously you could pass a `returning: 'minimal'` option to the `insert()`, `up
</details>
-## Updated Realtime API
+## Multiplayer Sneak Peek
-There are a few changes to our Realtime interface:
+There is a new `channel()` interface which we have released in v2.
+This is a "preparatory" release for our upcoming [multiplayer](https://supabase.com/blog/supabase-realtime-with-multiplayer-features) features.
+
+```ts
+supabaseClient
+ .channel('any_string_you_want')
+ .on('presence', { event: 'track' }, (payload) => {
+ console.log(payload)
+ })
+ .subscribe()
+```
+
+As part of this change, the old `from().on().subscribe()` method for listening to database changes will be changing:
```ts
// v2
@@ -140,7 +152,6 @@ supabaseClient
}
)
.subscribe()
-
// v1
supabase
.from('movies')
@@ -150,9 +161,8 @@ supabase
.subscribe()
```
-There is a new `channel()` function which requires a string to denote the name of a channel.
-While this may seem more verbose, it's an important change for our upcoming [multiplayer](https://supabase.com/blog/supabase-realtime-with-multiplayer-features) features.
You can listen to PostgreSQL database changes on any channel you want by subscribing to the `'postgres_changes'` event.
+For now, we will continue to support `from().on().subscribe()`, but in the future we will deprecate this in favor of the `channel().on().subscribe()` method.
## Community