supabase suscription configuration does not work

Viewed 22

I am trying to make the new object added to the events table appear on the console when I create an event, using supabase realtime. I have the configuration in supabase activated for realtime and the strangest thing is that yesterday the same script returned the payload in the console.The subscription is listening to the events table.

  const[events, setEvents] = useState([]);

  useEffect(() => {
    getUser();
    const subscription = supabase
    .from('events')
    .on('*', (payload) => {
      console.log(payload)
    })
    .subscribe();
    return() => {
      supabase.removeSubscription(subscription)
    }
  }, []);

Will I have the supabase subscription misconfigured?

0 Answers
Related