We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9ea40e9 commit c882aa0Copy full SHA for c882aa0
examples/sync/example.js
@@ -8,6 +8,22 @@ if (!url) {
8
const authToken = process.env.LIBSQL_AUTH_TOKEN;
9
10
const options = { syncUrl: url, authToken: authToken };
11
+
12
+// Sync also supports Turso Cloud encryption.
13
+//
14
+// Documentation: https://docs.turso.tech/cloud/encryption
15
16
17
+// export LIBSQL_ENCRYPTION_KEY="encryption key in base64 format"
18
19
+// The encryption key must be encoded in base64 format.
20
21
+const encryptionKey = process.env.LIBSQL_ENCRYPTION_KEY;
22
23
+if (encryptionKey) {
24
+ options.remoteEncryptionKey = encryptionKey;
25
+}
26
27
const db = new Database("hello.db", options);
28
29
db.sync();
0 commit comments