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
@@ -32,61 +32,159 @@ When combined with [Row-Level Security (RLS)](/docs/rls), OffSync allows you to
32
32
33
33
## Configuring OffSync
34
34
35
-
You can enable and manage OffSync for your databases directly from the SQLite Cloud dashboard.
36
-
The OffSync panel has four tabs: **Sync Tables**, **Configuration**, **Devices**, and **Metrics**.
35
+
You can enable and manage OffSync for your databases directly from the SQLite Cloud dashboard. Select a database from the left panel — the list shows all databases in your project along with their OffSync status. The right panel has four tabs: **Database Setup**, **Client Integration**, **Devices**, and **Metrics**.
37
36
38
37
### Enabling and Disabling OffSync
39
38
40
-
When OffSync is not yet active for a database, the panel shows a brief explanation and an **Enable OffSync** button. Clicking it opens a confirmation dialog; after confirming, the database is registered with the sync service and the tabbed view appears.
39
+
When OffSync is not yet active for a database, the right panel shows a brief explanation and an **Enable OffSync** button. Clicking it opens a confirmation dialog; after confirming, the database is registered with the sync service and the tabbed view appears.
41
40
42
-
To disable OffSync, click the **Disable OffSync** button in the top-right corner of the panel and confirm the action in the dialog that appears.
41
+
To disable OffSync, click the **Disable OffSync** button in the top-right corner of the panel and confirm in the dialog that appears.
43
42
44
43
{/* <VideoPlayer src={enableDisableSync} /> */}
45
44
46
-
### Enable Tables for Synchronization
45
+
---
46
+
47
+
## Database Setup Tab
48
+
49
+
The **Database Setup** tab handles the **server-side configuration** of OffSync. This is where you verify the database connection and choose which tables to synchronize.
50
+
51
+
### Connection Status
52
+
53
+
A connection card at the top of the tab shows whether the sync service can reach your database. When healthy, it displays the **Host**, **Port**, and **Database** name alongside a green **Connected** indicator.
54
+
55
+
If the connection cannot be established, a warning appears with an action button to resolve it:
56
+
57
+
- On **Supabase self-hosted / PostgreSQL** workspaces, click **Configure Connection** to provide the correct connection credentials via the connection settings sheet. The card also shows an **Edit** button when the connection is healthy, so you can update the credentials at any time.
58
+
- On **SQLite Cloud** workspaces, click **Restore Connection** to automatically regenerate the internal API key used by the sync service.
59
+
60
+
If the OffSync extension is not detected on the database, a warning is shown with a link to the installation documentation.
61
+
62
+
### Select Tables to Enable OffSync
63
+
64
+
Below the connection card, you can choose which tables to synchronize. This section is only shown when the connection is healthy. A counter shows how many tables are currently selected (e.g., *1 of 1 selected*).
65
+
66
+
- Use the **Filter tables** input to search through large table lists.
67
+
- Check or uncheck individual tables to include or exclude them from synchronization. Tables already registered with the sync service are marked as **Enabled**.
68
+
- Use **Select All** / **Deselect All** to manage the full list at once.
69
+
70
+
Once you have made your selection, click **Deploy Changes** (bottom-right of the panel) to apply. From that point on, any writes to those tables via the SQLite Sync extension will be automatically synchronized.
71
+
72
+
<Callouttype="note"title="Matching Schemas and Tables">
73
+
For OffSync to work correctly, the tables you enable for synchronization—and their schemas—must be identical in both your local SQLite database and your SQLite Cloud database.
74
+
</Callout>
47
75
48
-
From the **Sync Tables** tab, select which tables in your database you want to keep synchronized.
49
-
Once enabled, all changes to those tables will automatically sync with connected devices.
Show: Sync Tables tab open → toggle one or more tables on → confirmation that sync is active for those tables. */}
79
+
---
80
+
81
+
## Client Integration Tab
53
82
54
-
### Configuration Tab
83
+
The **Client Integration** tab contains everything you need to **connect your local application** to the cloud database. This includes your Database ID, how authentication works, and how to handle push notifications.
The options available in this tab depend on your workspace type. **SQLite Cloud** workspaces use API keys or access tokens. **Supabase self-hosted and PostgreSQL** workspaces use database credentials or JWT-based authentication. The relevant options are displayed automatically based on your project.
87
+
</Callout>
55
88
56
-
The **Configuration** tab contains two sub-sections:
89
+
### Database ID
57
90
58
-
**Database ID** — A read-only field showing the unique identifier for your OffSync-enabled database, with a copy button for convenience. Use this ID in your application to initialize the sync connection (see the <ahref="https://github.com/sqliteai/sqlite-sync"target="_blank">sqlite-sync README</a> for more details):
91
+
A unique identifier for your OffSync-enabled database. Pass this ID to the <ahref="https://github.com/sqliteai/sqlite-sync"target="_blank">SQLite Sync</a> extension in your client application to initialize the sync connection:
59
92
60
93
```sql
61
94
SELECT cloudsync_network_init('<database-id>');
62
95
```
63
96
64
-
**Push Notifications** — Push notifications work out of the box. If you have enabled Expo enhanced security, provide your access token here. This is only required when using the `sqlite-sync-react-native` library with push mode enabled — the token adds an extra layer of security to prevent unauthorized push notifications.
97
+
Use the **Copy** button to copy the ID to your clipboard.
98
+
99
+
### Row Level Security (RLS)
100
+
101
+
RLS controls which data each user can access. Instead of giving clients full access to the database, it ensures each user can only read or modify their own data. Choose one of two modes:
102
+
103
+
-**No, bypass RLS** — Best for trusted environments such as internal tools or server-side clients. The client has full access to all synced tables.
104
+
-**Yes, enforce RLS** — Best for user-facing apps. Each sync request is tied to a user identity, and access rules are applied automatically.
105
+
106
+
Your selection here determines how the **Authentication** section below is configured.
65
107
66
-
{/* VIDEO: dashboard_offsync_configuration.mp4
67
-
Show: Configuration tab open → Database ID field with copy button clicked → scroll down to Push Notifications section → paste an Expo token → save → status changes to "Working". */}
108
+
### Authentication
68
109
69
-
### Manage Connected Devices
110
+
The authentication method shown depends on your **workspace type** and **RLS mode** selection.
Connects using your database credentials, giving full access to all synced tables and bypassing Row Level Security. Refer to the quickstart guide shown at the top of the tab for provider-specific instructions.
To verify users and apply access rules, you must configure a JWT authentication provider. A status card shows the current configuration:
148
+
149
+
-**Not configured** — Users cannot be verified. Click **Configure authentication** to set up your provider.
150
+
-**Configured** — Shows the active method (HMAC Secret HS256 or JWKS Issuer Validation). Click **Edit** to update it.
151
+
152
+
Refer to the quickstart guide shown at the top of the tab for provider-specific integration instructions.
153
+
154
+
### Push Notifications
155
+
156
+
Real-time push notifications are active out of the box when using the <ahref="https://github.com/sqliteai/sqlite-sync-react-native"target="_blank">sqlite-sync-react-native</a> library with push mode enabled.
157
+
158
+
A status card shows the current **Expo Security** configuration:
159
+
160
+
-**Not configured** — Standard push notifications are active with no extra security.
161
+
-**Configured** — An Expo access token has been provided, adding an extra security layer to prevent unauthorized push notifications. The date the token was last updated is also shown.
162
+
163
+
Use **Configure** to add a token, **Edit** to update an existing one, or **Delete** to remove it.
The **Devices** tab lists all devices currently synchronized with the selected database. For each device you can see its **Site ID** and the timestamp of its **Last Sync**. Use the **Remove** button to deregister a device.
73
173
74
174
{/* VIDEO: dashboard_offsync_devices.mp4
75
-
Show: Devices tab open with a list of connected devices → inspect sync status of one device → remove a device from the list. */}
175
+
Show: Devices tab → list of connected devices → remove a device. */}
76
176
77
-
<Callouttype="note"title="Matching Schemas and Tables">
78
-
For OffSync to work correctly, the list of tables configured for synchronization—and their corresponding schemas—must be identical in both your local SQLite database and your SQLite Cloud database.
79
-
</Callout>
177
+
---
80
178
81
-
###Metrics Tab
179
+
## Metrics Tab
82
180
83
-
The **Metrics** tab provides visibility into daily and cumulative usage for your OffSync-enabled database:
181
+
The **Metrics** tab provides visibility into usage for your OffSync-enabled database over time:
84
182
85
183
-**Active devices** — number of devices that have synced within the period
86
184
-**Upload bytes** — data sent from devices to SQLite Cloud
87
185
-**Download bytes** — data sent from SQLite Cloud to devices
88
186
89
-
{/* VIDEO: dashboard_offsync_metrics.mp4
90
-
Show: Metrics tab open → scroll through active devices chart → upload bytes chart → download bytes chart, ideally with some non-zero data visible. */}
187
+
The usage summary at the top of the left panel shows the total data transferred for the current billing period.
91
188
92
-
Once enabled, any changes made to the selected tables via the SQLite Sync extension will be automatically synchronized with your SQLite Cloud database.
0 commit comments