© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•8mo ago•
5 replies
tirstain

Realtime subscriptions not working

Hi, I'm trying to enable realtime subscriptions for one of my tables and my subscription status is always 'TIMED_OUT' when I try to do an insert. Here is my code. I have RLS enabled and realtime enabled for my pursuit table and I have this policy

alter policy "Allow insert for all"
on "public"."pursuit"
to public
with check (
true
);
alter policy "Allow insert for all"
on "public"."pursuit"
to public
with check (
true
);


Here is my realtime code.

useEffect(() => {
    console.log("Setting up realtime listener...");

    const channel = supabase
      .channel("pursuit-insert-channel")
      .on(
        "postgres_changes",
        {
          event: "INSERT",
          schema: "public",
          table: "pursuit",
        },
        (payload) => {
          console.log("New pursuit inserted:", payload.new);
          getPursuits();
        }
      )
      .subscribe((status) => {
        console.log("Realtime subscription status:", status);
      });

    return () => {
      supabase.removeChannel(channel);
      console.log("Realtime unsubscribed");
    };
  }, []);
useEffect(() => {
    console.log("Setting up realtime listener...");

    const channel = supabase
      .channel("pursuit-insert-channel")
      .on(
        "postgres_changes",
        {
          event: "INSERT",
          schema: "public",
          table: "pursuit",
        },
        (payload) => {
          console.log("New pursuit inserted:", payload.new);
          getPursuits();
        }
      )
      .subscribe((status) => {
        console.log("Realtime subscription status:", status);
      });

    return () => {
      supabase.removeChannel(channel);
      console.log("Realtime unsubscribed");
    };
  }, []);
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

(solved) Realtime subscriptions not working with RLS?
SupabaseSSupabase / help-and-questions
4y ago
Nextjs and realtime subscriptions
SupabaseSSupabase / help-and-questions
4y ago
Realtime not working
SupabaseSSupabase / help-and-questions
4mo ago
Realtime not working
SupabaseSSupabase / help-and-questions
4y ago