You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -49,19 +50,15 @@ To run the hosted versions of PowerSync + Supabase, follow the steps below.
49
50
This section guides you through setting up the backend using Supabase and PowerSync. Follow the steps below to configure your backend environment.
50
51
51
52
#### 1. Setup Supabase
52
-
Follow these steps to set up your backend with Supabase and PowerSync (Or you can follow the [guide](https://docs.powersync.com/integration-guides/supabase-+-powersync)).
53
+
Follow these steps to set up your backend with Supabase and PowerSync (or you can follow the [guide](https://docs.powersync.com/integration-guides/supabase-+-powersync)).
53
54
54
-
<details>
55
-
<summary><strong>Option 1: Setup using the Supabase Dashboard</strong></summary>
56
55
57
56
1.[Create a new project on the Supabase dashboard](https://supabase.com/dashboard/projects).
58
57
2. Go to the Supabase SQL Editor for your new project and execute the SQL statements in [database.pgsql](database.pgsql) to create the database schema, database functions, and publication needed for PowerSync.
59
58
3. Enable "anonymous sign-ins" for the project [here](https://supabase.com/dashboard/project/_/auth/providers) (demo specific)
60
59
61
-
</details>
62
-
63
60
<details>
64
-
<summary><strong>Option 2: Setup using the Supabase CLI</strong></summary>
61
+
<summary><strong>Alternative: Setup using the Supabase CLI</strong></summary>
65
62
66
63
If you prefer using the Supabase CLI to develop the database locally and push it to a Supabase cloud later, you can set up your project as follows:
67
64
1. Login to your Supabase Account `npx supabase login`
@@ -79,30 +76,21 @@ If you prefer using the Supabase CLI to develop the database locally and push it
79
76
80
77
#### 2. Setup PowerSync Instance and Connect to Supabase
81
78
82
-
You can set up your PowerSync instance using either the Dashboard or CLI approach:
83
-
84
-
<details>
85
-
<summary><strong>Option 1: Setup using the PowerSync Dashboard</strong></summary>
86
-
87
-
If you prefer using the web interface:
88
-
89
79
1. In the [PowerSync dashboard](https://powersync.journeyapps.com/), create a new PowerSync instance:
90
80
- Right-click on 'PowerSync Project' in the project tree on the left and click "Create new instance"
91
81
- Pick a name for the instance e.g. "PowerSyncDemoInstance" and proceed.
92
82
93
83
2. In the "Edit Instance" dialog that follows, click on the "Connections" tab:
94
84
- Click on the "+" button to create a new database connection.
95
-
- Input the credentials from the project you created in Supabase. In the Supabase dashboard, under your project you can go to "Project Settings" and then "Database" and choose "URI" under "Connection string", **untick the "Use connection pooling" option** to use the direct connection, and then copy & paste the connection string into the PowerSync dashboard "URI" field, and then enter your database password at the "Password" field.
85
+
- Input the credentials from the project you created in Supabase. Go to [this page](https://supabase.com/dashboard/project/_?showConnect=true), copy & paste the connection string into the PowerSync dashboard "URI" field, and then enter your database password at the "Password" field. However, we do recommend using a dedicated database user for PowerSync, please refer to the [Source database guide](https://docs.powersync.com/installation/database-setup#2-create-a-powersync-database-user)
96
86
- Click the "Test connection" button and you should see "Connection success!"
97
87
98
88
3. Click on the "Credentials" tab of the "Edit Instance" dialog:
99
89
- Tick the "Use Supabase Auth" checkbox and configure the JWT secret.
100
90
- Click "Save" to save all the changes to your PowerSync instance. The instance will now be deployed — this may take a minute or two.
101
91
102
-
</details>
103
-
104
92
<details>
105
-
<summary><strong>Option 2: Setup using the PowerSync CLI</strong></summary>
93
+
<summary><strong>Alternative: Setup using the PowerSync CLI</strong></summary>
106
94
107
95
See [PowerSync CLI docs](https://docs.powersync.com/usage/tools/cli).
108
96
@@ -117,13 +105,11 @@ If you don't have a PowerSync account yet, [sign up here](https://accounts.journ
117
105
- Search for "Create Personal Access Token"
118
106
- Give it "owner" policy and a descriptive label
119
107
- Copy the generated token
120
-
121
108
2.**Initialize the CLI and authenticate:**
122
109
```bash
123
110
npx powersync init
124
111
```
125
112
Paste your Personal Access Token when prompted.
126
-
127
113
3.**Create a new PowerSync instance:**
128
114
```bash
129
115
npx powersync instance create
@@ -135,7 +121,6 @@ Follow the prompts to configure:
0 commit comments