The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.
TypeScript aialternativeauthdatabasedenoembeddingsexamplefirebasenextjsoauth2pgvectorpostgispostgrespostgresqlpostgrestrealtimesupabasevectorswebsockets
fix: Change example to use the new Authz format (#27570)
Filipe Cabaço7630e448dce3
diff --git a/examples/realtime/nextjs-authorization-demo/README.md b/examples/realtime/nextjs-authorization-demo/README.mdindex 1512a3a6356..e8826a14405 100644--- a/examples/realtime/nextjs-authorization-demo/README.md+++ b/examples/realtime/nextjs-authorization-demo/README.md@@ -1,14 +1,14 @@# SupaSecureSlack-Example application on how you can use Realtime Authorization feature to limit access to Realtime [Channels](https://supabase.com/docs/guides/realtime/concepts#channels) and limit access to the [Broadcast](https://supabase.com/docs/guides/realtime/broadcast) feature.+Example application on how you can use Realtime Authorization to limit access to Realtime [Channels](https://supabase.com/docs/guides/realtime/concepts#channels) and [Broadcast](https://supabase.com/docs/guides/realtime/broadcast) and [Presence](https://supabase.com/docs/guides/realtime/presence) extensions.You can provide feedback on our [Github Discussion](https://github.com/orgs/supabase/discussions/22484).## Objective-Build a chat system using Realtime Broadcast with Authorized Channels where users can create rooms and invite existing users to a room.+Build a chat system using Realtime Broadcast and Presence with Authorized Channels where users can create rooms and invite existing users to a room.-Each room restricts the number of users authorized by applying RLS policies applied to `public` schema tables you'll be creating and the auto-generated `realtime` schema tables.+Each room restricts users authorized by applying RLS policies applied to the `public` schema tables you'll be creating and the auto-generated `realtime.messages` tables.## Run It@@ -28,47 +28,47 @@ And here one of the user does not have access because their RLS rules made the u## Schema-We're taking advantage of Supabase's protected schemas to feed data to our application, namely `realtime.channels` and `auth.users`, so we can easily have cascading changes if a Channel / user is deleted.+We'll be using:-We also need `public.profiles` with a trigger so we have a way to offer a public email to be used to invite people to the chat room.--Here's an overview of the two `public` tables we'll be creating for this demo:--+- `public.profiles` - table that will be automatically updated using a trigger when new users are created+- `public.rooms` - a list of all unique rooms created+- `public.rooms_users` - the table responsible for the association between rooms and users## Database Setup### Create Tables-#### `public.profiles`-```sql+CREATE TABLE public.rooms (+ id bigint GENERATED BY default AS IDENTITY PRIMARY KEY,+ topic text NOT NULL+);++CREATE UNIQUE INDEX "unique_topic" on public.rooms (topic);+CREATE TABLE public.profiles (+ id bigint GENERATED BY default AS IDENTITY PRIMARY KEY,email text NOT NULL,user_id uuid REFERENCES auth.users (id));-```-#### `public.rooms_users`--```sqlCREATE TABLE public.rooms_users (- name text REFERENCES realtime.channels (name),user_id uuid REFERENCES auth.users (id),+ room_id bigint REFERENCES public.rooms (id),created_at timestamptz DEFAULT CURRENT_TIMESTAMP);++ALTER TABLE public.rooms ENABLE ROW LEVEL SECURITY;+ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY;+ALTER TABLE public.rooms_users ENABLE ROW LEVEL SECURITY;```### Create RLS Policies-We do have a lot of RLS policies to set up so we will group them by `schema.table` below.--The most noteworthy ones are the policies created for `realtime.broadcasts` table as they will limit access to rooms by checking if an entry for a given room name and user id exists in the `public.rooms_users` table.+We have to set up RLS policies for the `public` schema tables we created in the previous step as well as for the `realtime.messages` table. The policies created on this Realtime table will authorize user access to rooms and Broadcast/Presence by checking if an entry for a given room name and user id exists in the `public.rooms_users` table.> ⚠️ All the RLS policies here are meant for this demo. You may refer to them but make sure that your policies are tailored to your use case and secure your application.-#### `public.profiles`-```sqlCREATE POLICY "authenticated users can view all profiles"ON "public"."profiles"@@ -81,88 +81,58 @@ ON "public"."profiles"AS PERMISSIVE FOR INSERTTO supabase_auth_adminWITH CHECK (true);-```-#### `public.rooms_users`-```sql-CREATE POLICY "authenticated users can read rooms_users"-ON "public"."rooms_users"+CREATE POLICY "authenticated users can read rooms"+ON "public"."rooms"AS PERMISSIVE FOR SELECTTO authenticatedUSING (TRUE);-CREATE POLICY "authenticated can add rooms_users"-ON "public"."rooms_users"+CREATE POLICY "authenticated can add rooms"+ON "public"."rooms"AS PERMISSIVE FOR INSERTTO authenticatedWITH CHECK (TRUE);-```-#### `realtime.channels`-```sql-CREATE POLICY "authenticated users can see all channels"-ON "realtime"."channels"+CREATE POLICY "authenticated users can read rooms_users"+ON "public"."rooms_users"AS PERMISSIVE FOR SELECTTO authenticatedUSING (TRUE);-CREATE POLICY "authenticated can create channel"-ON "realtime"."channels"+CREATE POLICY "authenticated can add rooms_users"+ON "public"."rooms_users"AS PERMISSIVE FOR INSERTTO authenticatedWITH CHECK (TRUE);-```--#### `realtime.presences`-```sql-CREATE POLICY "authenticated users can see all presences"-ON "realtime"."presences"-AS PERMISSIVE FOR SELECT-TO authenticated-USING (TRUE);--CREATE POLICY "authenticated can track presences"-ON "realtime"."presences"-AS PERMISSIVE FOR UPDATE-TO authenticated-USING (TRUE);-```--#### `realtime.broadcasts`--```sqlCREATE POLICY "authenticated user can enter room"-ON "realtime"."broadcasts"+ON "realtime"."messages"AS PERMISSIVE FOR SELECTTO authenticatedUSING (EXISTS (- SELECT- ru.user_id- FROM- rooms_users ru- WHERE- ru.user_id = auth.uid()- AND ru.name = realtime.channel_name()+ SELECT ru.user_id+ FROM public.rooms_users ru+ JOIN public.rooms r ON r.id = ru.room_id AND r.topic = realtime.topic()+ WHERE ru.user_id = auth.uid()+ AND realtime.messages.extension in ('broadcast', 'presence')));CREATE POLICY "authenticated user can broadcast in room"-ON "realtime"."broadcasts"-AS PERMISSIVE FOR UPDATE+ON "realtime"."messages"+AS PERMISSIVE FOR INSERTTO authenticated-USING (+WITH CHECK (EXISTS (- SELECT- ru.user_id- FROM- rooms_users ru- WHERE- ru.user_id = auth.uid()- AND ru.name = realtime.channel_name()+ SELECT ru.user_id+ FROM public.rooms_users ru+ JOIN public.rooms r ON r.id = ru.room_id AND r.topic = realtime.topic()+ WHERE ru.user_id = auth.uid()+ AND realtime.messages.extension in ('broadcast', 'presence')));```@@ -172,7 +142,7 @@ USING (We need to create a database function and trigger to add an entry to `public.profiles` whenever a new user is created:```sql-CREATE OR REPLACE FUNCTION insert_user () RETURNS TRIGGER AS+CREATE OR REPLACE FUNCTION insert_user() RETURNS TRIGGER AS$$BEGININSERT INTO public.profiles (user_id, email) VALUES (NEW.id, NEW.email); RETURN NEW;@@ -181,53 +151,26 @@ $$ LANGUAGE plpgsql;CREATE OR REPLACE TRIGGER "on_new_auth_create_profile"AFTER INSERT ON auth.users FOR EACH ROW-EXECUTE FUNCTION insert_user ();+EXECUTE FUNCTION insert_user();GRANT EXECUTE ON FUNCTION insert_user () TO supabase_auth_admin;+GRANT INSERT ON TABLE public.profiles TO supabase_auth_admin;```## Coding Concerns-### Create Channels Requirement+* Check we're using the `2.10.0` version of `@supabase/realtime-js`+* You need to define that the channel is private using the new configuration field during channel creation:+ ```typescript+ let channel = supabase.realtime.channel(selectedRoom, {+ config: { broadcast: { self: true }, private: true },+ })+ ```-Before Realtime Authorization, Realtime Broadcast and Presence Channels were exposed to any client with a valid JWT, such as `anon` token.--If you want your Channel secured and adhere to RLS policies then you will need to create the Channel before allowing your clients to connect to the Channel.--> ⚠️ This will also impact access to `postgres_changes` Channels on connect.--You can create a Channel by making the following method call:--```ts-await supabase.realtime.createChannel(name)-```--You can check this code at the [create-room-modal.tsx](components/create-room-modal.tsx) component.--Also we're using the `next` version of `@supabase/realtime-js` which we need to override in `@supabase/supabase-js` in our [package.json](package.json):--```js-// ...-"overrides": {- "@supabase/supabase-js": {- "@supabase/realtime-js": "^2.10.0-next.6"- }- },-// ...-```--Or you can make a `POST` request to your project's `/realtime/v1/api/channels` endpoint:--```sh-curl -v -X POST 'https://<project_ref>.supabase.co/realtime/v1/api/channels'\- --header 'apikey: <anon_token>'\- --header 'Authorization: Bearer <access_token>' \- --header 'Content-Type: application/json'\- --data-raw '{ "name": "<channel name>" }'-```+You can check `app/protected/page.tsx` for more information regarding this-### Connecting to Broadcast is Essentially the Same+## Adding user to channel-The biggest difference between Broadcast and Broadcast Authorization is the latter's requirement of creating the Channel before clients subscribe to the Channel. Other than that, your clients can connect to Realtime Channel as they normally would and Realtime server will check RLS policies on client connect.+Type `/invite <email>` of an existing user and they will be added to the channel.-You can check this code at the [protected/page.tsx](app/protected/page.tsx).+\ No newline at end of filediff --git a/examples/realtime/nextjs-authorization-demo/app/login/page.tsx b/examples/realtime/nextjs-authorization-demo/app/login/page.tsxindex f2f6516619e..44ee5d933f6 100644--- a/examples/realtime/nextjs-authorization-demo/app/login/page.tsx+++ b/examples/realtime/nextjs-authorization-demo/app/login/page.tsx@@ -1,40 +1,36 @@-import Link from "next/link";-import { headers } from "next/headers";-import { createClient } from "@/utils/supabase/server";-import { redirect } from "next/navigation";-import { SubmitButton } from "../../components/submit-button";+import Link from 'next/link'+import { headers } from 'next/headers'+import { createClient } from '@/utils/supabase/server'+import { redirect } from 'next/navigation'+import { SubmitButton } from '../../components/submit-button'-export default function Login({- searchParams,-}: {- searchParams: { message: string };-}) {+export default function Login({ searchParams }: { searchParams: { message: string } }) {const signIn = async (formData: FormData) => {- "use server";+ 'use server'- const email = formData.get("email") as string;- const password = formData.get("password") as string;- const supabase = createClient();+ const email = formData.get('email') as string+ const password = formData.get('password') as string+ const supabase = createClient()const { error } = await supabase.auth.signInWithPassword({email,password,- });+ })if (error) {- return redirect("/login?message=Could not authenticate user");+ return redirect('/login?message=Could not authenticate user')}- return redirect("/protected");- };+ return redirect('/protected')+ }const signUp = async (formData: FormData) => {- "use server";+ 'use server'- const origin = headers().get("origin");- const email = formData.get("email") as string;- const password = formData.get("password") as string;- const supabase = createClient();+ const origin = headers().get('origin')+ const email = formData.get('email') as string+ const password = formData.get('password') as string+ const supabase = createClient()const { error } = await supabase.auth.signUp({email,@@ -42,14 +38,15 @@ export default function Login({options: {emailRedirectTo: `${origin}/auth/callback`,},- });+ })+ console.log(error)if (error) {- return redirect("/login?message=Could not authenticate user");+ return redirect('/login?message=Could not authenticate user')}- return redirect("/login?message=Check email to continue sign in process");- };+ return redirect('/login?message=Check email to continue sign in process')+ }return (<div className="flex-1 flex flex-col w-full px-8 sm:max-w-md justify-center gap-2">@@ -70,7 +67,7 @@ export default function Login({className="mr-2 h-4 w-4 transition-transform group-hover:-translate-x-1"><polyline points="15 18 9 12 15 6" />- </svg>{" "}+ </svg>{' '}Back</Link>@@ -115,5 +112,5 @@ export default function Login({)}</form></div>- );+ )}diff --git a/examples/realtime/nextjs-authorization-demo/app/protected/page.tsx b/examples/realtime/nextjs-authorization-demo/app/protected/page.tsxindex 0fb0b1b4f33..44ffd952573 100644--- a/examples/realtime/nextjs-authorization-demo/app/protected/page.tsx+++ b/examples/realtime/nextjs-authorization-demo/app/protected/page.tsx@@ -1,14 +1,16 @@'use client'import CreateRoomModal from '@/components/create-room-modal'-import { createClientComponentClient } from '@supabase/auth-helpers-nextjs'-import { RealtimeChannel } from '@supabase/realtime-js'-import { useState, useEffect } from 'react'+import { User, createClientComponentClient } from '@supabase/auth-helpers-nextjs'+import { RealtimeChannel } from '@supabase/supabase-js'+import { useState, useEffect, use } from 'react'export default function Chat() {- const [userId, setUserId] = useState<string | null>(null)+ const [user, setUser] = useState<User | null>(null)const [loading, setLoading] = useState<boolean>(true)- const [rooms, setRooms] = useState<any>([])+ const [rooms, setRooms] = useState<string[]>([])+ const [users, setUsers] = useState<Set<string>>(new Set())const [selectedRoom, setSelectedRoom] = useState<string | undefined>()+ const [mainChannel, setMainChannel] = useState<RealtimeChannel | null>(null)const [channel, setChannel] = useState<RealtimeChannel | null>(null)const [showModal, setShowModal] = useState<boolean>(false)const [error, setError] = useState<string | null>(null)@@ -16,19 +18,63 @@ export default function Chat() {const supabase = createClientComponentClient()const getChannels = async () => {- await supabase.auth.getUser()- const token = (await supabase.auth.getSession()).data.session?.access_token- if (!token) return-- supabase.realtime.setAuth(token)- const channels = await supabase.realtime.listChannels()- setRooms(channels.map((channel) => channel.name))- setLoading(false)+ const channels = await supabase.from('rooms').select('topic')+ setRooms(channels.data?.map(({ topic }) => topic) || [])+ }++ const addUserToChannel = async (email: string) => {+ const user = await supabase.from('profiles').select('user_id').eq('email', email)+ if (!user.data?.length) {+ addMessage(true, true, `User ${email} not found`)+ } else {+ const room = await supabase.from('rooms').select('id').eq('topic', selectedRoom)++ await supabase+ .from('rooms_users')+ .upsert({ user_id: user.data?.[0].user_id, room_id: room.data?.[0].id })+ addMessage(true, true, `Added ${email} to channel ${selectedRoom}`)+ }+ }++ const addMessage = async (mine: boolean, system: boolean, message: string) => {+ const bubble = document.createElement('div')+ const is_self_classes = mine ? ['bg-green-600', 'self-end'] : ['bg-blue-600', 'self-start']+ const is_system_classes = system ? ['bg-stone-500', 'self-center', 'italic', 'text-center'] : []+ const style = [+ 'flex',+ 'gap-2',+ 'items-center',+ 'rounded-xl',+ 'text-white',+ 'text-bold',+ 'w-2/3',+ 'p-2',+ ]+ .concat(is_self_classes)+ .concat(is_system_classes)+ bubble.classList.add(...style)+ bubble.innerHTML = message+ document.getElementById('chat')!.appendChild(bubble)}useEffect(() => {- getChannels()- supabase.auth.getUser().then((user) => setUserId(user.data.user?.id || null))+ supabase.auth+ .getUser()+ .then((user) => setUser(user.data.user))+ .then(async () => {+ await supabase.auth.getUser()+ const token = (await supabase.auth.getSession()).data.session?.access_token!+ supabase.realtime.setAuth(token)+ let main = supabase.realtime+ .channel('supaslack')+ .on('broadcast', { event: 'new_room' }, () => getChannels())+ .subscribe()+ setMainChannel(main)+ getChannels()+ })+ .then(() => {+ setLoading(false)+ })}, [supabase])useEffect(() => {@@ -38,43 +84,40 @@ export default function Chat() {if (selectedRoom) {channel?.unsubscribe()+ setUsers(new Set())let newChannel = supabase.realtime.channel(selectedRoom, {- config: { broadcast: { self: true } },+ config: {+ broadcast: { self: true },+ private: true, // This line will tell the server that you want to use a private channel for this connection+ },})newChannel- .on('broadcast', { event: 'message' }, ({ payload: payload }) => {- const bubble = document.createElement('div')- const mine =- payload.user_id == userId ? ['bg-green-600', 'self-end'] : ['bg-blue-600', 'self-start']- const style = [- 'flex',- 'gap-2',- 'items-center',- 'rounded-xl',- 'text-white',- 'text-bold',- 'w-2/3',- 'p-2',- ].concat(mine)- bubble.classList.add(...style)- bubble.innerHTML = payload.message- document.getElementById('chat')!.appendChild(bubble)+ .on('broadcast', { event: 'message' }, ({ payload: payload }) =>+ addMessage(payload.user_id == user?.id, false, payload.message)+ )+ .on('presence', { event: 'join' }, ({ newPresences }) => {+ newPresences.map(({ email }) => users.add(email))+ setUsers(new Set(users))+ })+ .on('presence', { event: 'leave' }, ({ leftPresences }) => {+ leftPresences.map(({ email }) => users.delete(email))+ setUsers(new Set(users))}).subscribe((status, err) => {+ setLoading(false)+if (status == 'SUBSCRIBED') {setChannel(newChannel)- setLoading(false)+ newChannel.track({ email: user?.email })setError(null)}if (status == 'CLOSED') {setChannel(null)}if (status == 'CHANNEL_ERROR') {- console.log({ status, err })setError(err?.message || null)- setLoading(false)}})}@@ -87,11 +130,12 @@ export default function Chat() {<div className="animate-spin rounded-full h-32 w-32 border-b-2 border-foreground"></div></div>)}- {showModal ? <CreateRoomModal /> : ''}+ {showModal ? <CreateRoomModal channel={mainChannel} /> : ''}<div className="flex w-full h-full gap-4">- <div className="grow-0 flex flex-col gap-2">+ <div className="grow-0 flex flex-col gap-2 w-[20rem] overflow-hidden"><div className="bg-white h-full rounded-sm text-slate-900">- <div className="flex flex-col sm:max-w-md gap-2 text-foreground">+ <div className="flex flex-col">+ <div className="p-2 font-semibold bg-stone-100 w-full text-center">Rooms</div>{rooms?.map((room: string) => {return (<button@@ -102,16 +146,24 @@ export default function Chat() {}}className={selectedRoom == room- ? 'bg-green-600 rounded-sm pointer p-1 text-white'- : 'rounded-sm cursor-pointer hover:bg-green-100 p-1 text-black'+ ? 'bg-green-600 rounded-sm pointer p-2 text-white text-left'+ : 'rounded-sm cursor-pointer hover:bg-green-100 p-2 text-black text-left'}>- # {room}+ #{room}</button>)})}</div></div>+ <div className="bg-white h-full rounded-sm text-slate-900">+ <div className="p-2 font-semibold bg-stone-100 w-full text-center">Users in Room</div>+ <div className="flex flex-col gap-2 p-2">+ {Array.from(users)?.map((email: string) => {+ return <div key={email}>{email}</div>+ })}+ </div>+ </div><buttonclassName="border border-foreground/20 rounded-md px-4 py-2 text-foreground"onClick={() => setShowModal(!showModal)}@@ -138,11 +190,18 @@ export default function Chat() {const form = e.target as HTMLFormElementconst target = form.elements[0] as HTMLInputElementconst message = target.value- channel?.send({- type: 'broadcast',- event: 'message',- payload: { message, user_id: userId },- })++ if (message.startsWith('/invite')) {+ const email = message.replace('/invite ', '')+ addUserToChannel(email)+ } else {+ channel?.send({+ type: 'broadcast',+ event: 'message',+ payload: { message, user_id: user?.id },+ })+ }+target.value = ''}}>diff --git a/examples/realtime/nextjs-authorization-demo/chat_success.png b/examples/realtime/nextjs-authorization-demo/chat_success.pngindex d627b6c4f12..91c96654ef1 100644Binary files a/examples/realtime/nextjs-authorization-demo/chat_success.png and b/examples/realtime/nextjs-authorization-demo/chat_success.png differdiff --git a/examples/realtime/nextjs-authorization-demo/chat_unauthorized.png b/examples/realtime/nextjs-authorization-demo/chat_unauthorized.pngindex 147b9249ef0..c9c7b35941c 100644Binary files a/examples/realtime/nextjs-authorization-demo/chat_unauthorized.png and b/examples/realtime/nextjs-authorization-demo/chat_unauthorized.png differdiff --git a/examples/realtime/nextjs-authorization-demo/components/create-room-modal.tsx b/examples/realtime/nextjs-authorization-demo/components/create-room-modal.tsxindex 9e8c565fa4b..e37b0f7651a 100644--- a/examples/realtime/nextjs-authorization-demo/components/create-room-modal.tsx+++ b/examples/realtime/nextjs-authorization-demo/components/create-room-modal.tsx@@ -3,69 +3,65 @@ import { createClient } from '@/utils/supabase/client'import { redirect } from 'next/navigation'import { SubmitButton } from './submit-button'import { useEffect, useState } from 'react'+import { RealtimeChannel } from '@supabase/supabase-js'-export default function CreateRoomModal() {+export default function CreateRoomModal({ channel }: { channel: RealtimeChannel | null }) {const supabase = createClient()- const [emails, setEmails] = useState<{ email: string; user_id: string }[] | undefined>([])- useEffect(() => {- supabase- .from('profiles')- .select('*')- .then((res) => setEmails(res.data as { email: string; user_id: string }[]))- }, [])-const createRoom = async (formData: FormData) => {- const name = formData.get('name') as string- const ids = formData.getAll('emails[]')- await supabase.auth.getUser()+ const topic = formData.get('topic') as string+ const user = await supabase.auth.getUser()const token = (await supabase.auth.getSession()).data.session!.access_token+supabase.realtime.setAuth(token)- await supabase.realtime.createChannel(name)- await supabase.from('rooms_users').insert(ids.map((user_id) => ({ user_id, name })))- return redirect(`/protected`)++ const rooms_response = await supabase.from('rooms').insert({ topic }).select('id')++ if (rooms_response.data) {+ await supabase+ .from('rooms_users')+ .insert({ user_id: user.data.user!.id, room_id: rooms_response.data![0].id })++ await channel?.send({+ type: 'broadcast',+ event: 'new_room',+ payload: {},+ })++ return redirect(`/protected`)+ }}const close = async () => {return redirect(`/protected`)}+return (- <div className="fixed top-0 left-0 right-0 flex flex-col h-full w-full justify-center items-center align-middle gap-2 z-10 bg-[#000000AA]">+ <div className="fixed top-0 left-0 right-0 flex flex-col h-full w-full justify-center items-center align-middle gap-2 z-10 bg-[#000000EE]"><form className="flex flex-col sm:max-w-md gap-2 text-foreground bg-background rounded-md p-4">- <label className="text-md" htmlFor="email">- Room+ <label className="text-lg font-semibold" htmlFor="email">+ Create a Room</label><inputclassName="rounded-md px-4 py-2 bg-inherit border mb-6"- name="name"+ name="topic"placeholder="room_1"/>- {emails && (- <div className="flex flex-col">- {emails?.map(({ email, user_id }) => (- <div key={`container_${email}`}>- <input key={`label_${email}`} type="checkbox" name="emails[]" value={user_id} />-- <label key={email} htmlFor="emails[]">- {email}- </label>- </div>- ))}- </div>- )}- <SubmitButton- formAction={createRoom}- className="border border-foreground/20 rounded-md px-4 py-2 text-foreground mb-2"- pendingText="Creating"- >- Create Room- </SubmitButton>- <SubmitButton- formAction={close}- className="border border-foreground/20 rounded-md px-4 py-2 text-foreground mb-2"- pendingText="Closing"- >- Close- </SubmitButton>+ <div className="flex justify-between gap-4">+ <SubmitButton+ formAction={createRoom}+ className="border border-foreground/20 rounded-md px-4 py-2 text-foreground mb-2 w-[10rem]"+ pendingText="Creating"+ >+ Create Room+ </SubmitButton>+ <SubmitButton+ formAction={close}+ className="border border-foreground/20 rounded-md px-4 py-2 text-foreground mb-2 w-[10rem]"+ pendingText="Closing"+ >+ Close+ </SubmitButton>+ </div></form></div>)diff --git a/examples/realtime/nextjs-authorization-demo/invite.png b/examples/realtime/nextjs-authorization-demo/invite.pngnew file mode 100644index 00000000000..7b57a692de4Binary files /dev/null and b/examples/realtime/nextjs-authorization-demo/invite.png differdiff --git a/examples/realtime/nextjs-authorization-demo/package-lock.json b/examples/realtime/nextjs-authorization-demo/package-lock.jsonindex 8fabd6d0e78..68272a3e424 100644--- a/examples/realtime/nextjs-authorization-demo/package-lock.json+++ b/examples/realtime/nextjs-authorization-demo/package-lock.json@@ -6,9 +6,8 @@"": {"dependencies": {"@supabase/auth-helpers-nextjs": "^0.9.0",- "@supabase/realtime-js": "^2.10.0-next.5","@supabase/ssr": "latest",- "@supabase/supabase-js": "latest",+ "@supabase/supabase-js": "2.44.0","autoprefixer": "10.4.17","geist": "^1.2.1","next": "latest",@@ -99,14 +98,14 @@}},"node_modules/@next/env": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/env/-/env-14.1.4.tgz",- "integrity": "sha512-e7X7bbn3Z6DWnDi75UWn+REgAbLEqxI8Tq2pkFOFAMpWAWApz/YCUhtWMWn410h8Q2fYiYL7Yg5OlxMOCfFjJQ=="+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.4.tgz",+ "integrity": "sha512-3EtkY5VDkuV2+lNmKlbkibIJxcO4oIHEhBWne6PaAp+76J9KoSsGvNikp6ivzAT8dhhBMYrm6op2pS1ApG0Hzg=="},"node_modules/@next/swc-darwin-arm64": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.1.4.tgz",- "integrity": "sha512-ubmUkbmW65nIAOmoxT1IROZdmmJMmdYvXIe8211send9ZYJu+SqxSnJM4TrPj9wmL6g9Atvj0S/2cFmMSS99jg==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.4.tgz",+ "integrity": "sha512-AH3mO4JlFUqsYcwFUHb1wAKlebHU/Hv2u2kb1pAuRanDZ7pD/A/KPD98RHZmwsJpdHQwfEc/06mgpSzwrJYnNg==","cpu": ["arm64"],@@ -119,9 +118,9 @@}},"node_modules/@next/swc-darwin-x64": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.1.4.tgz",- "integrity": "sha512-b0Xo1ELj3u7IkZWAKcJPJEhBop117U78l70nfoQGo4xUSvv0PJSTaV4U9xQBLvZlnjsYkc8RwQN1HoH/oQmLlQ==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.4.tgz",+ "integrity": "sha512-QVadW73sWIO6E2VroyUjuAxhWLZWEpiFqHdZdoQ/AMpN9YWGuHV8t2rChr0ahy+irKX5mlDU7OY68k3n4tAZTg==","cpu": ["x64"],@@ -134,9 +133,9 @@}},"node_modules/@next/swc-linux-arm64-gnu": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.1.4.tgz",- "integrity": "sha512-457G0hcLrdYA/u1O2XkRMsDKId5VKe3uKPvrKVOyuARa6nXrdhJOOYU9hkKKyQTMru1B8qEP78IAhf/1XnVqKA==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.4.tgz",+ "integrity": "sha512-KT6GUrb3oyCfcfJ+WliXuJnD6pCpZiosx2X3k66HLR+DMoilRb76LpWPGb4tZprawTtcnyrv75ElD6VncVamUQ==","cpu": ["arm64"],@@ -149,9 +148,9 @@}},"node_modules/@next/swc-linux-arm64-musl": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.1.4.tgz",- "integrity": "sha512-l/kMG+z6MB+fKA9KdtyprkTQ1ihlJcBh66cf0HvqGP+rXBbOXX0dpJatjZbHeunvEHoBBS69GYQG5ry78JMy3g==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.4.tgz",+ "integrity": "sha512-Alv8/XGSs/ytwQcbCHwze1HmiIkIVhDHYLjczSVrf0Wi2MvKn/blt7+S6FJitj3yTlMwMxII1gIJ9WepI4aZ/A==","cpu": ["arm64"],@@ -164,9 +163,9 @@}},"node_modules/@next/swc-linux-x64-gnu": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.1.4.tgz",- "integrity": "sha512-BapIFZ3ZRnvQ1uWbmqEGJuPT9cgLwvKtxhK/L2t4QYO7l+/DxXuIGjvp1x8rvfa/x1FFSsipERZK70pewbtJtw==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.4.tgz",+ "integrity": "sha512-ze0ShQDBPCqxLImzw4sCdfnB3lRmN3qGMB2GWDRlq5Wqy4G36pxtNOo2usu/Nm9+V2Rh/QQnrRc2l94kYFXO6Q==","cpu": ["x64"],@@ -179,9 +178,9 @@}},"node_modules/@next/swc-linux-x64-musl": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.1.4.tgz",- "integrity": "sha512-mqVxTwk4XuBl49qn2A5UmzFImoL1iLm0KQQwtdRJRKl21ylQwwGCxJtIYo2rbfkZHoSKlh/YgztY0qH3wG1xIg==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.4.tgz",+ "integrity": "sha512-8dwC0UJoc6fC7PX70csdaznVMNr16hQrTDAMPvLPloazlcaWfdPogq+UpZX6Drqb1OBlwowz8iG7WR0Tzk/diQ==","cpu": ["x64"],@@ -194,9 +193,9 @@}},"node_modules/@next/swc-win32-arm64-msvc": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.1.4.tgz",- "integrity": "sha512-xzxF4ErcumXjO2Pvg/wVGrtr9QQJLk3IyQX1ddAC/fi6/5jZCZ9xpuL9Tzc4KPWMFq8GGWFVDMshZOdHGdkvag==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.4.tgz",+ "integrity": "sha512-jxyg67NbEWkDyvM+O8UDbPAyYRZqGLQDTPwvrBBeOSyVWW/jFQkQKQ70JDqDSYg1ZDdl+E3nkbFbq8xM8E9x8A==","cpu": ["arm64"],@@ -209,9 +208,9 @@}},"node_modules/@next/swc-win32-ia32-msvc": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.1.4.tgz",- "integrity": "sha512-WZiz8OdbkpRw6/IU/lredZWKKZopUMhcI2F+XiMAcPja0uZYdMTZQRoQ0WZcvinn9xZAidimE7tN9W5v9Yyfyw==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.4.tgz",+ "integrity": "sha512-twrmN753hjXRdcrZmZttb/m5xaCBFa48Dt3FbeEItpJArxriYDunWxJn+QFXdJ3hPkm4u7CKxncVvnmgQMY1ag==","cpu": ["ia32"],@@ -224,9 +223,9 @@}},"node_modules/@next/swc-win32-x64-msvc": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.1.4.tgz",- "integrity": "sha512-4Rto21sPfw555sZ/XNLqfxDUNeLhNYGO2dlPqsnuCg8N8a2a9u1ltqBOPQ4vj1Gf7eJC0W2hHG2eYUHuiXgY2w==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.4.tgz",+ "integrity": "sha512-tkLrjBzqFTP8DVrAAQmZelEahfR9OxWpFR++vAI9FBhCiIxtwHwBHC23SBHCTURBtwB4kc/x44imVOnkKGNVGg==","cpu": ["x64"],@@ -303,17 +302,17 @@}},"node_modules/@supabase/auth-js": {- "version": "2.63.0",- "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.63.0.tgz",- "integrity": "sha512-yIgcHnlgv24GxHtVGUhwGqAFDyJkPIC/xjx7HostN08A8yCy8HIfl4JEkTKyBqD1v1L05jNEJOUke4Lf4O1+Qg==",+ "version": "2.64.2",+ "resolved": "https://registry.npmjs.org/@supabase/auth-js/-/auth-js-2.64.2.tgz",+ "integrity": "sha512-s+lkHEdGiczDrzXJ1YWt2y3bxRi+qIUnXcgkpLSrId7yjBeaXBFygNjTaoZLG02KNcYwbuZ9qkEIqmj2hF7svw==","dependencies": {"@supabase/node-fetch": "^2.6.14"}},"node_modules/@supabase/functions-js": {- "version": "2.2.2",- "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.2.2.tgz",- "integrity": "sha512-sJGq1nludmi7pY/fdtCpyY/pYonx7MfHdN408bqb736guWcVI1AChYVbI4kUM978EuOE4Ci6l7bUudfGg07QRw==",+ "version": "2.4.1",+ "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.4.1.tgz",+ "integrity": "sha512-8sZ2ibwHlf+WkHDUZJUXqqmPvWQ3UHN0W30behOJngVh/qHHekhJLCFbh0AjkE9/FqqXtf9eoVvmYgfCLk5tNA==","dependencies": {"@supabase/node-fetch": "^2.6.14"}@@ -330,17 +329,17 @@}},"node_modules/@supabase/postgrest-js": {- "version": "1.15.0",- "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.15.0.tgz",- "integrity": "sha512-U4bwBOrhsXWqDjZiYNbVqMBtRGgIIYE0kE5ZNSwsIbeBWfr/UxOMrnkIQUBGIZRhpYW/tw1WnTdRl1AGNyaxcw==",+ "version": "1.15.6",+ "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.15.6.tgz",+ "integrity": "sha512-zg3URVhoHOijdqMyn3LIFHh+Pqj5BmRqWAaoSExzIHc4m0kGBMPMjDcleamGhbelAAiKbjpQ04mBgooDliGl5A==","dependencies": {"@supabase/node-fetch": "^2.6.14"}},"node_modules/@supabase/realtime-js": {- "version": "2.10.0-next.6",- "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.0-next.6.tgz",- "integrity": "sha512-v9OyiigZyk20Rwhd/4swQr0eghuBJHds7OthxGcTk/Qf58rQlLzrlOPZys2PTuxZ1FnzEX+0SIj+a2rLheA+tA==",+ "version": "2.10.1",+ "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.10.1.tgz",+ "integrity": "sha512-SrrXxE8xgwWvjREQMkC9LIHIoCQde+OqkFPKP2s/O0ROjhmJ/iXeLvoWhAzXh9gwire4oaK14/ncL/iRiaVWQw==","dependencies": {"@supabase/node-fetch": "^2.6.14","@types/phoenix": "^1.5.4",@@ -349,9 +348,9 @@}},"node_modules/@supabase/ssr": {- "version": "0.1.0",- "resolved": "https://registry.npmjs.org/@supabase/ssr/-/ssr-0.1.0.tgz",- "integrity": "sha512-bIVrkqjAK5G3KjkIMKYKtAOlCgRRplEWjrlyRyXSOYtgDieiOhk2ZyNAPsEOa1By9OZVxuX5eAW1fitdnuxayw==",+ "version": "0.3.0",+ "resolved": "https://registry.npmjs.org/@supabase/ssr/-/ssr-0.3.0.tgz",+ "integrity": "sha512-lcVyQ7H6eumb2FB1Wa2N+jYWMfq6CFza3KapikT0fgttMQ+QvDgpNogx9jI8bZgKds+XFSMCojxFvFb+gwdbfA==","dependencies": {"cookie": "^0.5.0","ramda": "^0.29.0"@@ -361,31 +360,37 @@}},"node_modules/@supabase/storage-js": {- "version": "2.5.5",- "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.5.tgz",- "integrity": "sha512-OpLoDRjFwClwc2cjTJZG8XviTiQH4Ik8sCiMK5v7et0MDu2QlXjCAW3ljxJB5+z/KazdMOTnySi+hysxWUPu3w==",+ "version": "2.6.0",+ "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.6.0.tgz",+ "integrity": "sha512-REAxr7myf+3utMkI2oOmZ6sdplMZZ71/2NEIEMBZHL9Fkmm3/JnaOZVSRqvG4LStYj2v5WhCruCzuMn6oD/Drw==","dependencies": {"@supabase/node-fetch": "^2.6.14"}},"node_modules/@supabase/supabase-js": {- "version": "2.42.0",- "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.42.0.tgz",- "integrity": "sha512-1PDqJiA4iG45w3AAu6xkccJ3wPqlGJUoz9CPhScRLLTStxhewYhz0mjryTpXz1kgtNHdUAsirALreezn8UZMjA==",+ "version": "2.44.0",+ "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.44.0.tgz",+ "integrity": "sha512-SzMvAgSVuPzx7itiYiascXAVBqTcZ9zX3ONIdhZEWKUEgWaJftfPyVvz+PMYznK77miSMuy1f4geAvPElyiS2g==","dependencies": {- "@supabase/auth-js": "2.63.0",- "@supabase/functions-js": "2.2.2",+ "@supabase/auth-js": "2.64.2",+ "@supabase/functions-js": "2.4.1","@supabase/node-fetch": "2.6.15",- "@supabase/postgrest-js": "1.15.0",- "@supabase/realtime-js": "2.9.3",- "@supabase/storage-js": "2.5.5"+ "@supabase/postgrest-js": "1.15.6",+ "@supabase/realtime-js": "2.10.1",+ "@supabase/storage-js": "2.6.0"}},+ "node_modules/@swc/counter": {+ "version": "0.1.3",+ "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz",+ "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ=="+ },"node_modules/@swc/helpers": {- "version": "0.5.2",- "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.2.tgz",- "integrity": "sha512-E4KcWTpoLHqwPHLxidpOqQbcrZVgi0rsmmZXUle1jXmJfuIf/UWpczUJ7MZZ5tlxytgJXyp0w4PGkkeLiuIdZw==",+ "version": "0.5.5",+ "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz",+ "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==","dependencies": {+ "@swc/counter": "^0.1.3","tslib": "^2.4.0"}},@@ -398,9 +403,9 @@}},"node_modules/@types/phoenix": {- "version": "1.6.4",- "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.4.tgz",- "integrity": "sha512-B34A7uot1Cv0XtaHRYDATltAdKx0BvVKNgYNqE4WjtPUa4VQJM7kxeXcVKaH+KS+kCmZ+6w+QaUdcljiheiBJA=="+ "version": "1.6.5",+ "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.5.tgz",+ "integrity": "sha512-xegpDuR+z0UqG9fwHqNoy3rI7JDlvaPh2TY47Fl80oq6g+hXT+c/LEuE43X48clZ6lOfANl5WrPur9fYO1RJ/w=="},"node_modules/@types/prop-types": {"version": "15.7.12",@@ -547,20 +552,20 @@}},"node_modules/braces": {- "version": "3.0.2",- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==","dependencies": {- "fill-range": "^7.0.1"+ "fill-range": "^7.1.1"},"engines": {"node": ">=8"}},"node_modules/browserslist": {- "version": "4.23.0",- "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz",- "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==",+ "version": "4.23.1",+ "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz",+ "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==","funding": [{"type": "opencollective",@@ -576,10 +581,10 @@}],"dependencies": {- "caniuse-lite": "^1.0.30001587",- "electron-to-chromium": "^1.4.668",+ "caniuse-lite": "^1.0.30001629",+ "electron-to-chromium": "^1.4.796","node-releases": "^2.0.14",- "update-browserslist-db": "^1.0.13"+ "update-browserslist-db": "^1.0.16"},"bin": {"browserslist": "cli.js"@@ -608,9 +613,9 @@}},"node_modules/caniuse-lite": {- "version": "1.0.30001606",- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001606.tgz",- "integrity": "sha512-LPbwnW4vfpJId225pwjZJOgX1m9sGfbw/RKJvw/t0QhYOOaTXHvkjVGFGPpvwEzufrjvTlsULnVTxdy4/6cqkg==",+ "version": "1.0.30001634",+ "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001634.tgz",+ "integrity": "sha512-fbBYXQ9q3+yp1q1gBk86tOFs4pyn/yxFm5ZNP18OXJDfA3txImOY9PhfxVggZ4vRHDqoU8NrKU81eN0OtzOgRA==","funding": [{"type": "opencollective",@@ -743,9 +748,9 @@"integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA=="},"node_modules/electron-to-chromium": {- "version": "1.4.729",- "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.729.tgz",- "integrity": "sha512-bx7+5Saea/qu14kmPTDHQxkp2UnziG3iajUQu3BxFvCOnpAJdDbMV4rSl+EqFDkkpNNVUFlR1kDfpL59xfy1HA=="+ "version": "1.4.802",+ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.802.tgz",+ "integrity": "sha512-TnTMUATbgNdPXVSHsxvNVSG0uEd6cSZsANjm8c9HbvflZVVn1yTRcmVXYT1Ma95/ssB/Dcd30AHweH2TE+dNpA=="},"node_modules/emoji-regex": {"version": "9.2.2",@@ -804,9 +809,9 @@}},"node_modules/fill-range": {- "version": "7.0.1",- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",+ "version": "7.1.1",+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==","dependencies": {"to-regex-range": "^5.0.1"},@@ -815,9 +820,9 @@}},"node_modules/foreground-child": {- "version": "3.1.1",- "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.1.1.tgz",- "integrity": "sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==",+ "version": "3.2.0",+ "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.2.0.tgz",+ "integrity": "sha512-CrWQNaEl1/6WeZoarcM9LHupTo3RpZO2Pdk1vktwzPiQTsJnAKJmm3TACKeG5UZbWDfaH2AbvYxzP96y0MT7fA==","dependencies": {"cross-spawn": "^7.0.0","signal-exit": "^4.0.1"@@ -871,21 +876,21 @@}},"node_modules/glob": {- "version": "10.3.12",- "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz",- "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==",+ "version": "10.4.1",+ "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz",+ "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==","dependencies": {"foreground-child": "^3.1.0",- "jackspeak": "^2.3.6",- "minimatch": "^9.0.1",- "minipass": "^7.0.4",- "path-scurry": "^1.10.2"+ "jackspeak": "^3.1.2",+ "minimatch": "^9.0.4",+ "minipass": "^7.1.2",+ "path-scurry": "^1.11.1"},"bin": {"glob": "dist/esm/bin.mjs"},"engines": {- "node": ">=16 || 14 >=14.17"+ "node": ">=16 || 14 >=14.18"},"funding": {"url": "https://github.com/sponsors/isaacs"@@ -993,9 +998,9 @@"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="},"node_modules/jackspeak": {- "version": "2.3.6",- "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-2.3.6.tgz",- "integrity": "sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==",+ "version": "3.4.0",+ "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz",+ "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==","dependencies": {"@isaacs/cliui": "^8.0.2"},@@ -1010,9 +1015,9 @@}},"node_modules/jiti": {- "version": "1.21.0",- "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.0.tgz",- "integrity": "sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==",+ "version": "1.21.6",+ "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.21.6.tgz",+ "integrity": "sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==","bin": {"jiti": "bin/jiti.js"}@@ -1055,9 +1060,9 @@}},"node_modules/lru-cache": {- "version": "10.2.0",- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz",- "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==",+ "version": "10.2.2",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz",+ "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==","engines": {"node": "14 || >=16.14"}@@ -1071,11 +1076,11 @@}},"node_modules/micromatch": {- "version": "4.0.5",- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",- "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",+ "version": "4.0.7",+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz",+ "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==","dependencies": {- "braces": "^3.0.2",+ "braces": "^3.0.3","picomatch": "^2.3.1"},"engines": {@@ -1097,9 +1102,9 @@}},"node_modules/minipass": {- "version": "7.0.4",- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz",- "integrity": "sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ==",+ "version": "7.1.2",+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",+ "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==","engines": {"node": ">=16 || 14 >=14.17"}@@ -1132,12 +1137,12 @@}},"node_modules/next": {- "version": "14.1.4",- "resolved": "https://registry.npmjs.org/next/-/next-14.1.4.tgz",- "integrity": "sha512-1WTaXeSrUwlz/XcnhGTY7+8eiaFvdet5z9u3V2jb+Ek1vFo0VhHKSAIJvDWfQpttWjnyw14kBeq28TPq7bTeEQ==",+ "version": "14.2.4",+ "resolved": "https://registry.npmjs.org/next/-/next-14.2.4.tgz",+ "integrity": "sha512-R8/V7vugY+822rsQGQCjoLhMuC9oFj9SOi4Cl4b2wjDrseD0LRZ10W7R6Czo4w9ZznVSshKjuIomsRjvm9EKJQ==","dependencies": {- "@next/env": "14.1.4",- "@swc/helpers": "0.5.2",+ "@next/env": "14.2.4",+ "@swc/helpers": "0.5.5","busboy": "1.6.0","caniuse-lite": "^1.0.30001579","graceful-fs": "^4.2.11",@@ -1151,18 +1156,19 @@"node": ">=18.17.0"},"optionalDependencies": {- "@next/swc-darwin-arm64": "14.1.4",- "@next/swc-darwin-x64": "14.1.4",- "@next/swc-linux-arm64-gnu": "14.1.4",- "@next/swc-linux-arm64-musl": "14.1.4",- "@next/swc-linux-x64-gnu": "14.1.4",- "@next/swc-linux-x64-musl": "14.1.4",- "@next/swc-win32-arm64-msvc": "14.1.4",- "@next/swc-win32-ia32-msvc": "14.1.4",- "@next/swc-win32-x64-msvc": "14.1.4"+ "@next/swc-darwin-arm64": "14.2.4",+ "@next/swc-darwin-x64": "14.2.4",+ "@next/swc-linux-arm64-gnu": "14.2.4",+ "@next/swc-linux-arm64-musl": "14.2.4",+ "@next/swc-linux-x64-gnu": "14.2.4",+ "@next/swc-linux-x64-musl": "14.2.4",+ "@next/swc-win32-arm64-msvc": "14.2.4",+ "@next/swc-win32-ia32-msvc": "14.2.4",+ "@next/swc-win32-x64-msvc": "14.2.4"},"peerDependencies": {"@opentelemetry/api": "^1.1.0",+ "@playwright/test": "^1.41.2","react": "^18.2.0","react-dom": "^18.2.0","sass": "^1.3.0"@@ -1171,6 +1177,9 @@"@opentelemetry/api": {"optional": true},+ "@playwright/test": {+ "optional": true+ },"sass": {"optional": true}@@ -1254,24 +1263,24 @@"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="},"node_modules/path-scurry": {- "version": "1.10.2",- "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz",- "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==",+ "version": "1.11.1",+ "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz",+ "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==","dependencies": {"lru-cache": "^10.2.0","minipass": "^5.0.0 || ^6.0.2 || ^7.0.0"},"engines": {- "node": ">=16 || 14 >=14.17"+ "node": ">=16 || 14 >=14.18"},"funding": {"url": "https://github.com/sponsors/isaacs"}},"node_modules/picocolors": {- "version": "1.0.0",- "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",- "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ=="+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz",+ "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew=="},"node_modules/picomatch": {"version": "2.3.1",@@ -1396,9 +1405,9 @@}},"node_modules/postcss-load-config/node_modules/lilconfig": {- "version": "3.1.1",- "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz",- "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==",+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.2.tgz",+ "integrity": "sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==","engines": {"node": ">=14"},@@ -1425,9 +1434,9 @@}},"node_modules/postcss-selector-parser": {- "version": "6.0.16",- "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.0.16.tgz",- "integrity": "sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==",+ "version": "6.1.0",+ "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.0.tgz",+ "integrity": "sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==","dependencies": {"cssesc": "^3.0.0","util-deprecate": "^1.0.2"@@ -1565,9 +1574,9 @@"dev": true},"node_modules/scheduler": {- "version": "0.23.0",- "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz",- "integrity": "sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==",+ "version": "0.23.2",+ "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",+ "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==","dependencies": {"loose-envify": "^1.1.0"}@@ -1842,9 +1851,9 @@"integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA=="},"node_modules/tslib": {- "version": "2.6.2",- "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",- "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q=="+ "version": "2.6.3",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz",+ "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ=="},"node_modules/typescript": {"version": "5.3.3",@@ -1864,9 +1873,9 @@"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="},"node_modules/update-browserslist-db": {- "version": "1.0.13",- "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz",- "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==",+ "version": "1.0.16",+ "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz",+ "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==","funding": [{"type": "opencollective",@@ -1882,8 +1891,8 @@}],"dependencies": {- "escalade": "^3.1.1",- "picocolors": "^1.0.0"+ "escalade": "^3.1.2",+ "picocolors": "^1.0.1"},"bin": {"update-browserslist-db": "cli.js"@@ -2010,9 +2019,9 @@}},"node_modules/ws": {- "version": "8.16.0",- "resolved": "https://registry.npmjs.org/ws/-/ws-8.16.0.tgz",- "integrity": "sha512-HS0c//TP7Ina87TfiPUz1rQzMhHrl/SG2guqRcTOIUYD2q8uhUdNHZYJUaQ8aTGPzCh+c6oawMKW35nFl1dxyQ==",+ "version": "8.17.1",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz",+ "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==","engines": {"node": ">=10.0.0"},@@ -2030,9 +2039,9 @@}},"node_modules/yaml": {- "version": "2.4.1",- "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.1.tgz",- "integrity": "sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==",+ "version": "2.4.5",+ "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz",+ "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==","bin": {"yaml": "bin.mjs"},diff --git a/examples/realtime/nextjs-authorization-demo/package.json b/examples/realtime/nextjs-authorization-demo/package.jsonindex 18b9e88dce0..904c35f4b46 100644--- a/examples/realtime/nextjs-authorization-demo/package.json+++ b/examples/realtime/nextjs-authorization-demo/package.json@@ -1,6 +1,6 @@{"private": true,- "engines" : {+ "engines": {"node": ">=20.0.0"},"scripts": {@@ -10,9 +10,8 @@},"dependencies": {"@supabase/auth-helpers-nextjs": "^0.9.0",- "@supabase/realtime-js": "^2.10.0-next.5","@supabase/ssr": "latest",- "@supabase/supabase-js": "latest",+ "@supabase/supabase-js": "2.44.0","autoprefixer": "10.4.17","geist": "^1.2.1","next": "latest",@@ -22,11 +21,6 @@"tailwindcss": "3.4.1","typescript": "5.3.3"},- "overrides": {- "@supabase/supabase-js": {- "@supabase/realtime-js": "^2.10.0-next.6"- }- },"devDependencies": {"@types/node": "20.11.5","@types/react": "18.2.48",diff --git a/examples/realtime/nextjs-authorization-demo/schema.png b/examples/realtime/nextjs-authorization-demo/schema.pngdeleted file mode 100644index 586fe929d73..00000000000Binary files a/examples/realtime/nextjs-authorization-demo/schema.png and /dev/null differ