Skip to content

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

docs: Update JS code sample for Realtime authz channel (#27977)

Tylerf6f9df667d7b
diff --git a/apps/docs/content/guides/realtime/authorization.mdx b/apps/docs/content/guides/realtime/authorization.mdx
index 8ec414cbf6f..5e800762690 100644
--- a/apps/docs/content/guides/realtime/authorization.mdx
+++ b/apps/docs/content/guides/realtime/authorization.mdx
@@ -131,20 +131,14 @@ Then, to join a topic with RLS enabled, instantiate the Channel with the `privat
queryGroup="language"
>
<TabPanel id="js" label="JavaScript">
- ```typescript
- import { createClient } from 'npm:@supabase/[email protected]'
- const url = 'https://<project_ref>.supabase.com'
- const apikey = '<api_key>'
-
- const client = createClient(url, apikey)
-
- const channel = client.channel('room-1', {
+ ```javascript
+ const channel = supabase.channel('room-1', {
config: { private: true },
})
channel
.on('broadcast', { event: 'test' }, (payload) => console.log(payload))
- .subscribe((status: string, err: any) => {
+ .subscribe((status, err) => {
if (status === 'SUBSCRIBED') {
console.log('Connected!')
} else {