Database:Subscribe to real-time changes
Last updated
Last updated
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:
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.
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.
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.
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!