Skip to content

Commit 3272150

Browse files
committed
Docs: add a comment to describe the option to token-based auth
1 parent b0066da commit 3272150

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ SELECT * FROM my_data ORDER BY created_at;
174174
-- Configure network connection before using the network sync functions
175175
SELECT cloudsync_network_init('sqlitecloud://your-project-id.sqlite.cloud/database.sqlite');
176176
SELECT cloudsync_network_set_apikey('your-api-key-here');
177+
-- Or use token authentication (required for Row-Level Security)
178+
-- SELECT cloudsync_network_set_token('your_auth_token');
177179

178180
-- Sync with cloud: send local changes, then check the remote server for new changes
179181
-- and, if a package with changes is ready to be downloaded, applies them to the local database

examples/simple-todo-db/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Before using the local CLI, you need to set up your cloud database:
2929
2. Enable RLS for tables you want to secure
3030
3. Create policies to control user access (e.g., users can only see their own tasks)
3131

32-
**Note**: RLS rules only apply to token-authenticated users. RLS rules are not enforced for API key-authenticated accesses.
32+
**Note**: RLS rules only apply to token authenticated users. RLS rules are not enforced for apikey authenticated accesses. For more information about tokens, refer to the [Access Tokens documentation](https://docs.sqlitecloud.io/docs/access-tokens).
3333

3434
## Step 2: Local Database Setup (Device A)
3535

@@ -107,8 +107,11 @@ SELECT cloudsync_is_enabled('tasks');
107107
-- Replace with your actual connection string from Step 1.3
108108
SELECT cloudsync_network_init('sqlitecloud://your-project-id.sqlite.cloud/todo_app.sqlite');
109109

110+
-- Configure authentication:
110111
-- Set your API key from Step 1.3
111112
SELECT cloudsync_network_set_apikey('your-api-key-here');
113+
-- Or use token authentication (required for Row-Level Security)
114+
-- SELECT cloudsync_network_set_token('your_auth_token');
112115

113116
-- Optional: Test connection
114117
SELECT cloudsync_network_sync();

0 commit comments

Comments
 (0)