Skip to content

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

re-order

Copple5d918ef28fdc
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 c78a669bb41..8a352fa6d65 100644
--- a/apps/www/_blog/2022-08-16-supabase-js-v2.mdx
+++ b/apps/www/_blog/2022-08-16-supabase-js-v2.mdx
@@ -1,5 +1,5 @@
---
-title: 'Supabase.js v2 release candidate'
+title: 'supabase-js v2 Release Candidate'
description: First peek of supabase-js v2, which focuses on quality-of-life improvements for developers.
author: inian
image: lw5-supabase-js/thumb.jpg
@@ -106,51 +106,6 @@ Previously you could pass a `returning: 'minimal'` option to the `insert()`, `up
</details>
-### Multiplayer Sneak Peek
-
-There is a new `channel()` interface which are releasing 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
-supabaseClient
- .channel('any_string_you_want')
- .on(
- 'postgres_changes',
- {
- event: 'INSERT',
- schema: 'public',
- table: 'movies',
- },
- (payload) => {
- console.log(payload)
- }
- )
- .subscribe()
-
-// v1
-supabase
- .from('movies')
- .on('INSERT', (payload) => {
- console.log(payload)
- })
- .subscribe()
-```
-
-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.
-
### Auth Admin methods
We've move all server-side Auth methods from `supabase.auth.api` to `supabase.auth.admin`:
@@ -262,6 +217,51 @@ const { data: user, error } = await supabase.functions.invoke('hello', {
This improvement inspired by a Supabase community member. Thanks [@vejja](https://github.com/supabase/functions-js/pull/23)!
+### Multiplayer Sneak Peek
+
+There is a new `channel()` interface which are releasing 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
+supabaseClient
+ .channel('any_string_you_want')
+ .on(
+ 'postgres_changes',
+ {
+ event: 'INSERT',
+ schema: 'public',
+ table: 'movies',
+ },
+ (payload) => {
+ console.log(payload)
+ }
+ )
+ .subscribe()
+
+// v1
+supabase
+ .from('movies')
+ .on('INSERT', (payload) => {
+ console.log(payload)
+ })
+ .subscribe()
+```
+
+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
Version 2.0 is the result of the combined work of over 100 contributors to our libraries, and over 450 contributors to our docs and websites.