Video walkthrough of the integration guide.
Before you proceed, this guide assumes that you have already signed up for free accounts with both Supabase and PowerSync Cloud (our cloud-hosted offering). If you haven’t signed up for a PowerSync (Cloud) account yet, click here (and if you haven’t signed up for Supabase yet, click here).
For mobile/desktop apps, this guide assumes that you already have Flutter / React Native / Kotlin / Xcode set up.For web apps, this guide assumes that you have pnpm installed.
This guide takes 10-15 minutes to complete.
Architecture
Upon successful integration of Supabase + PowerSync, your system architecture will look like this: (click to enlarge image)
For more details on PowerSync’s general architecture, see here.
Integration Guide/Tutorial Overview
We will follow these steps to get an offline-first ‘To-Do List’ demo app up and running:1
Configure Supabase:
- Create the demo database schema
- Create the Postgres user and publication
2
Configure PowerSync:
- Create connection to Supabase
- Configure Sync Rules
3
Test the configuration
Test the configuration using our provided PowerSync-Supabase ‘To-Do List’ demo app with your framework of choice.
Configure Supabase
Create a new Supabase project (or use an existing project if you prefer) and follow the below steps.Create the Demo Database Schema
To set up the Postgres database for our To-Do List demo app, we will create two new tables:lists and todos. The demo app will have access to these tables even while offline.
Run the below SQL statements in your Supabase SQL Editor:
Create a PowerSync Database User
PowerSync uses the Postgres Write Ahead Log (WAL) to replicate data changes in order to keep PowerSync SDK clients up to date. Run the below SQL statement in your Supabase SQL Editor to create a Postgres role/user with replication privileges:SELECT privilege, and for the publication mentioned in the next step (as well as for any other publications that may exist).
Create the Postgres Publication
Run the below SQL statement in your Supabase SQL Editor to create a Postgres publication:Configuring PowerSync
Create a PowerSync Cloud Instance
When creating a project in the PowerSync Dashboard, a Development and Production instance will be created by default. Select the instance you want to configure. If you need to create a new instance, follow the steps below.- In the dashboard, select your project and open the instance selection dropdown. Click Add Instance.

- Give your instance a name, such as “Production”.
- [Optional] You can change the default cloud region from US to EU, JP (Japan), AU (Australia) or BR (Brazil) if desired.
- Note: Additional cloud regions will be considered on request, especially for customers on our Enterprise plan. Please contact us if you need a different region.
- Click Create Instance.
Connect PowerSync to Your Supabase
-
From your Supabase Dashboard, select Connect in the top navigation bar (or follow this link):

-
In the Direct connection section, copy the complete connection string (including the
[YOUR-PASSWORD]placeholder)
- In the PowerSync Dashboard, select your project and instance and go to the Database Connections view.
- Click Connect to Source Database and ensure the “Postgres” tab is selected.
- Paste the connection string into the URI field. PowerSync will automatically parse this URI to populate the database connection details.
-
Update the Username and Password fields to use the
powersync_roleand password you created when configuring your Supabase for PowerSync (see Source Database Setup). -
Note: PowerSync includes Supabase’s CA certificate by default, so you can use
verify-fullSSL mode without additional configuration.

Your Supabase connection details should look similar to this.
- Verify your setup by clicking Test Connection and resolve any errors.
- Click Save Connection.
Enable Supabase Auth
After your database connection is configured, enable Supabase Auth:- In the PowerSync Dashboard, go to the Client Auth view.
- Enable the “Use Supabase Auth” checkbox.
- If your Supabase project uses the legacy JWT signing keys, copy your JWT Secret from your project’s settings (JWT Keys) and paste the secret into the “Supabase JWT Secret (optional) Legacy” field. If you’re using Supabase’s new JWT signing keys, you can leave this field empty.
- Click Save and Deploy to apply the changes.
PowerSync is compatible with Supabase’s new JWT signing keys. If you’re using the new keys, you don’t need to provide the legacy JWT secret. See this Discord thread for details.
Configure Sync Rules
Sync Rules allow developers to control which data gets synced to which user devices using a SQL-like syntax in a YAML file. For the demo app, we’re going to specify that each user can only see their own to-do lists and list items.- In the PowerSync Dashboard, select your project and instance and go to the Sync Rules view.
- Edit the Sync Rules in the editor and replace the contents with the below:
- Click “Validate” and ensure there are no errors. This validates your Sync Rules against your Postgres database.
- Click “Deploy” to deploy your Sync Rules.
Test Everything (Using Our Demo App)
In this step you’ll test your setup using a ‘To-Do List’ demo app provided by PowerSync.Clone the demo app
Clone the demo app based on your framework:Configure the demo app to use your PowerSync instance
Locate the relevant config file for your framework:- In the relevant config file, replace the values for
supabaseUrl(from the Project URL section in the Supabase dashboard) andsupabaseAnonKey(from the API Keys section in the Supabase dashboard) - For the value of
powersyncUrl, click Connect in the top bar of the PowerSync Dashboard and copy the instance URL from the dialog.
Run the app
For ease of use of the demo app, you can disable email confirmation in your Supabase Auth settings. In your Supabase project, go to “Authentication” -> “Providers” -> “Email” and then disable “Confirm email”. If you keep email confirmation enabled, the Supabase user confirmation email will reference the default Supabase Site URL of
http://localhost:3000 — you can ignore this.