Database:Subscribe to real-time changes

Getting real-time updates in your app's UI is a powerful feature, and Supabase makes it pretty straightforward with real-time database subscriptions. Let’s get those real-time updates flowing:

  1. Navigate to the Database Tab

    • Within your Supabase project, click on the 'Database' tab on the left-hand side panel to dive into the database management area.

  2. Access Database Publications

    • Find and select 'Publications' from the options listed under 'Database'. This area is all about setting up what data changes you want to listen for.

  3. Subscribe to Tables

    • In the Publications section, you'll see a list of all your tables. there are five tables in particular that we're focusing on.

    • Look for the tables outlined with red in your screenshot: ApiLog, OAuthClient, todos, user_api_limits, and users.

    • Toggle on the switch next to each of these tables to subscribe to real-time changes. This means that any updates, inserts, or deletes happening in these tables will be pushed live to your app.

  1. Enable Real-time Functionality

    • By toggling these switches, you activate Supabase's real-time functionality for these tables. Now your backend is set to publish changes as they happen.

The real-time functionality you need for your app is already in place—no extra coding required from your end.

And there you go! You’ve now got a back-end that whispers every little secret change to your front-end, keeping everything fresh and synced. Time to show off that seamless real-time magic in your app!

Last updated