Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 27 additions & 20 deletions snippets/supabase-database-connection.mdx
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
1. In your Supabase Dashboard, click **Connect** in the top bar:

<Frame>
<img src="/images/installation/supabase-connect-database.png" />
</Frame>
1. From your Supabase Dashboard, select **Connect** in the top navigation bar:

* Under **Direct connection**, copy the connection string. The hostname should be `db.<PROJECT-ID>.supabase.co`, and not, for example, `aws-0-us-west-1.pooler.supabase.com`.

<Frame>
<img src="/images/installation/supabase-connection-string.png" />
</Frame>
<Frame>
<img src="/images/installation/supabase-connect-database.png" />
</Frame>

* In the **Direct connection** section, copy the complete connection string (including the `[YOUR-PASSWORD]` placeholder)

<Frame>
<img src="/images/installation/supabase-connection-string.png" />
</Frame>

* Paste this URI in PowerSync instance **URI** field.
* Paste the connection string into the PowerSync instance **URI** field. PowerSync will automatically parse this URI to populate the connection details.

* Enter the **Password** for the `postgres` user in your Supabase database.
* For the **Password** field, enter your database's `postgres` user password (this is your database/project password, not your Supabase account password). Need help? Check Supabase's guide on [managing database passwords](https://supabase.com/docs/guides/database/managing-passwords).

* Supabase also [refers to this password](https://supabase.com/docs/guides/database/managing-passwords) as the *database password* or *project password*.
* Note: PowerSync includes Supabase's CA certificate by default, so you can use `verify-full` SSL mode without additional configuration.

Your connection settings should look similar to this:

<Frame>
<img src="/images/integration-guides/powersync-supabase-connection.png" />
</Frame>

* PowerSync has the Supabase CA certificate pre-configured — `verify-full` SSL mode can be used directly, without any custom certificates.
2. Verify your setup by clicking **Test Connection** and resolve any errors.

2. Click **Test Connection** and fix any errors.
3. Configure authentication:
* Navigate to the **Client Auth** tab
* Enable **Use Supabase Auth**
* Enter your Supabase **JWT Secret**

3. Under the **Client Auth** tab, enable **Use Supabase Auth** and enter your Supabase **JWT Secret**:

<Frame caption="PowerSync uses the secret to verify Supabase's JWTs">
<Frame caption="PowerSync will use this secret to validate Supabase JWTs">
<img src="/images/authentication/use-supabase-auth.png" />
</Frame>

4. Click **Save and deploy** to deploy the updates to your instance.
4. Click **Save and deploy** to apply your changes.

PowerSync deploys and configures an isolated cloud environment for you, which will take a few minutes to complete.
PowerSync will now create an isolated cloud environment for your instance. This process typically takes a few minutes.
Loading