Skip to content

Commit 4a52a1e

Browse files
committed
docs: update quickstarts
1 parent f713490 commit 4a52a1e

File tree

2 files changed

+44
-96
lines changed

2 files changed

+44
-96
lines changed

docs/postgresql/quickstarts/postgres.md

Lines changed: 22 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -84,72 +84,45 @@ If the extension is installed correctly, PostgreSQL returns the CloudSync versio
8484

8585
## Step 3: Register Your Database in the CloudSync Dashboard
8686

87-
### 2.1 Create a Workspace
87+
In the [CloudSync dashboard](https://dashboard.sqlitecloud.io/), create a new workspace with the **PostgreSQL** provider, then add a project with your PostgreSQL connection string:
8888

89-
1. Log in to the CloudSync dashboard
90-
2. Click **New Workspace**
91-
3. Choose provider: **PostgreSQL**
92-
4. Enter a workspace name
93-
5. Click **Create**
89+
```
90+
postgresql://user:password@host:5432/database
91+
```
9492

95-
### 2.2 Create a CloudSync Project
93+
---
9694

97-
1. In the workspace, click **New CloudSync Project**
98-
2. **Project name:** Give it a descriptive name
99-
3. **Connection string:** Enter your PostgreSQL connection:
100-
```
101-
postgresql://user:password@host:5432/database
102-
```
103-
5. Click **Create**
95+
## Step 4: Enable CloudSync on Tables
96+
97+
In the dashboard, go to the **Database Setup** tab, select the tables you want to sync, and click **Deploy Changes**.
10498

10599
---
106100

107-
## Step 4: Set Up Authentication
101+
## Step 5: Set Up Authentication
102+
103+
On the **Client Integration** tab you'll find your **Database ID** and authentication settings.
108104

109105
### Quick Test with API Key (Recommended for Testing)
110106

111107
The fastest way to test CloudSync without per-user access control — no JWT setup needed.
112108

113-
1. Get PostgreSQL credentials for a user with sufficient permissions on the tables CloudSync will sync
114-
2. In your client code (SQLite), authenticate with:
115-
```sql
116-
SELECT cloudsync_network_init('<database-id>');
117-
SELECT cloudsync_network_set_apikey('<username>:<password>');
118-
SELECT cloudsync_network_sync();
119-
```
109+
Under **Authentication (Username & Password)**, use your PostgreSQL credentials:
120110

121-
The API key is simply your PostgreSQL credentials in `username:password` format. No JWT configuration needed.
111+
```sql
112+
SELECT cloudsync_network_init('<database-id>');
113+
SELECT cloudsync_network_set_apikey('<username>:<password>');
114+
SELECT cloudsync_network_sync();
115+
```
122116

123117
### Using JWT Tokens (For RLS and Production)
124118

125-
If you need role-based access control (RLS) or production security:
126-
127-
1. **Prepare your JWT authentication:**
128-
- **For HS256 (shared secret):** Use your existing secret, or generate one: `openssl rand -base64 32`
129-
- **For RS256 (asymmetric/JWKS):** Have your auth system's issuer URL and JWKS endpoint ready
130-
2. **Update CloudSync dashboard configuration:**
131-
- Go to your project's **Configuration** tab
132-
- Click **Edit connection settings**
133-
- **For HS256 (shared secret):** Enter your JWT secret
134-
- **For RS256 (asymmetric):** Enter the same issuer base URL used in the token's `iss` claim, for example `https://your-auth-domain`
135-
- Do not include `/.well-known/jwks.json` in this field. CloudSync uses the issuer URL and fetches the JWKS document automatically.
136-
- Click **Save**
137-
3. **Get JWT tokens** — choose one:
138-
- **Testing only:** [jwt.io](https://jwt.io/) — paste your JWT secret, generate a test token
139-
- **Existing auth system:** Use tokens from your current auth provider
140-
4. **In your client code:**
119+
1. Set **Row Level Security** to **Yes, enforce RLS**
120+
2. Under **Authentication (JWT)**, click **Configure authentication** and choose:
121+
- **HMAC Secret (HS256):** Enter your JWT secret (or generate one: `openssl rand -base64 32`)
122+
- **JWKS Issuer Validation:** Enter the issuer base URL from your token's `iss` claim (e.g. `https://your-auth-domain`). CloudSync fetches the JWKS document automatically
123+
3. In your client code:
141124
```sql
142125
SELECT cloudsync_network_init('<database-id>');
143126
SELECT cloudsync_network_set_token('<jwt-token>');
144127
SELECT cloudsync_network_sync();
145128
```
146-
147-
---
148-
149-
## Step 5: Enable CloudSync on Tables
150-
151-
1. In the CloudSync dashboard, go to the **Sync Tables** tab
152-
2. **Select tables** you want to sync (checkbox each table)
153-
3. Click **Deploy Changes**
154-
155-
CloudSync is now active on your selected tables.

docs/postgresql/quickstarts/supabase.md

Lines changed: 22 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -85,70 +85,45 @@ If the extension is installed correctly, PostgreSQL returns the CloudSync versio
8585

8686
## Step 3: Register Your Database in the CloudSync Dashboard
8787

88-
### 2.1 Create a Workspace
88+
In the [CloudSync dashboard](https://dashboard.sqlitecloud.io/), create a new workspace with the **Supabase (Self-hosted)** provider, then add a project with your PostgreSQL connection string:
8989

90-
1. Log in to the CloudSync dashboard
91-
2. Click **New Workspace**
92-
3. Choose provider: **Supabase (Self-hosted)**
93-
4. Enter a workspace name
94-
5. Click **Create**
90+
```
91+
postgresql://user:password@host:5432/database
92+
```
9593

96-
### 2.2 Create a CloudSync Project
94+
---
9795

98-
1. In the workspace, click **New CloudSync Project**
99-
2. **Project name:** Give it a descriptive name (e.g., `my-app-sync`)
100-
3. **Connection string:** Enter your PostgreSQL connection:
101-
```
102-
postgresql://user:password@host:5432/database
103-
```
104-
4. Click **Create**
96+
## Step 4: Enable CloudSync on Tables
97+
98+
In the dashboard, go to the **Database Setup** tab, select the tables you want to sync, and click **Deploy Changes**.
10599

106100
---
107101

108-
## Step 4: Set Up Authentication
102+
## Step 5: Set Up Authentication
103+
104+
On the **Client Integration** tab you'll find your **Database ID** and authentication settings.
109105

110106
### Quick Test with API Key (Recommended for Testing)
111107

112108
The fastest way to test CloudSync without per-user access control — no JWT setup needed.
113109

114-
1. Get PostgreSQL credentials for a user with sufficient permissions on the tables CloudSync will sync
115-
2. In your client code (SQLite), authenticate with:
116-
```sql
117-
SELECT cloudsync_network_init('<database-id>');
118-
SELECT cloudsync_network_set_apikey('<username>:<password>');
119-
SELECT cloudsync_network_sync();
120-
```
110+
Under **Authentication (Username & Password)**, use your PostgreSQL credentials:
121111

122-
The API key is simply your PostgreSQL credentials in `username:password` format. No JWT configuration needed.
112+
```sql
113+
SELECT cloudsync_network_init('<database-id>');
114+
SELECT cloudsync_network_set_apikey('<username>:<password>');
115+
SELECT cloudsync_network_sync();
116+
```
123117

124118
### Using JWT Tokens (For RLS and Production)
125119

126-
If you need role-based access control (RLS) or production security:
127-
128-
1. **Choose your JWT authentication method:**
129-
- **Default (HS256 - Shared Secret):** Supabase auto-generates `JWT_SECRET` in `.env`
130-
- **GoTrue/JWKS (RS256 - Asymmetric):** Use Supabase's GoTrue service with JWKS endpoint
131-
2. **Configure JWT in the CloudSync dashboard:**
132-
- Go to **Configuration** tab → **Edit connection settings**
133-
- **For HS256:** Enter your **JWT secret** (from `.env`)
134-
- **For RS256/JWKS:** Enter the same issuer base URL used in the token's `iss` claim, for example `https://your-auth-domain`
135-
- Do not include `/.well-known/jwks.json` in this field. CloudSync uses the issuer URL and fetches the JWKS document automatically.
136-
- Click **Save**
137-
3. **Generate JWT tokens:**
138-
- Use [Supabase's built-in authentication](https://supabase.com/docs/guides/auth/jwts) to generate tokens
139-
4. **In your client code:**
120+
1. Set **Row Level Security** to **Yes, enforce RLS**
121+
2. Under **Authentication (JWT)**, click **Configure authentication** and choose:
122+
- **HMAC Secret (HS256):** Enter your `JWT_SECRET` from Supabase's `.env`
123+
- **JWKS Issuer Validation:** Enter the issuer base URL from your token's `iss` claim. CloudSync fetches the JWKS document automatically
124+
3. In your client code:
140125
```sql
141126
SELECT cloudsync_network_init('<database-id>');
142127
SELECT cloudsync_network_set_token('<jwt-token>');
143128
SELECT cloudsync_network_sync();
144129
```
145-
146-
---
147-
148-
## Step 5: Enable CloudSync on Tables
149-
150-
1. In the CloudSync dashboard, go to the **Tables** tab
151-
2. **Select tables** you want to sync (checkbox each table)
152-
3. Click **Deploy Changes**
153-
154-
CloudSync is now active on your selected tables.

0 commit comments

Comments
 (0)