DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to push live database changes to app users with Supabase

Send inserts, updates, and deletes to connected clients over websockets as they happen.

Who it is forDeveloper building a chat, live dashboard, or collaborative tool that must show data changes without page reloads.

The problemPolling the database from the browser wastes requests and shows stale data between polls.

The outcomeConnected clients receive database change events in near real time, limited to the data they are allowed to see.

What you need first

  • A Supabase account at https://supabase.com/dashboard, or a self-hosted install following the self-host guide
  • A basic understanding of Postgres tables and rows
  • A client library for your app language, such as supabase-js for JavaScript or TypeScript, listed in the README client table

Steps

  1. Set up a Supabase project and create the table whose changes you want to stream.
  2. Turn on access rules so each client only receives rows it is authorized to read.
  3. Subscribe to realtime changes from your app using the realtime client in the client library for your language.
  4. Insert or update a test row from another session and confirm the subscribed client receives the event.
  5. Handle reconnects in your app so updates resume after a dropped connection.

Prompt for your agent

Using the supabase/supabase README and the Realtime subscriptions docs, write a client subscription for inserts and updates on the <table name> table. Output the subscription code and a test script that changes one row. Verify that a second client only receives rows its access rules allow.

Caveat. The README says Realtime polls Postgres replication and broadcasts changes to authorized clients, but it does not give latency figures, so test delivery speed on your own setup.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page