Skip to content

Commit 1728dc9

Browse files
committed
Update README with encryption instructions
1 parent 885266a commit 1728dc9

File tree

2 files changed

+16857
-20673
lines changed

2 files changed

+16857
-20673
lines changed

packages/powersync-op-sqlite/README.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Overview
44

5-
This package (`packages/powersync-op-sqlite`) enables using [OP-SQLite](https://github.com/op-engineering/op-sqlite) with PowerSync alongside the [React Native SDK](https://docs.powersync.com/client-sdk-references/react-native-and-expo).
5+
This package (`packages/powersync-op-sqlite`) enables using [OP-SQLite](https://github.com/op-engineering/op-sqlite) with PowerSync alongside the [React Native SDK](https://docs.powersync.com/client-sdk-references/react-native-and-expo).
66

77
If you are not yet familiar with PowerSync, please see the [PowerSync React Native SDK README](https://github.com/powersync-ja/powersync-js/tree/main/packages/react-native) for more information.
88

@@ -43,6 +43,31 @@ const factory = new OPSqliteOpenFactory({
4343
this.powersync = new PowerSyncDatabase({ database: factory, schema: AppSchema });
4444
```
4545

46+
### Encryption with SQLCipher
47+
48+
To enable SQLCipher you need to add the following configuration option to your application's `package.json`
49+
50+
```json
51+
{
52+
// your normal package.json
53+
// ...
54+
"op-sqlite": {
55+
"sqlcipher": true
56+
}
57+
}
58+
```
59+
60+
Additionally you will need to add an encryption key to the OPSQLite factory constructor
61+
62+
```typescript
63+
const factory = new OPSqliteOpenFactory({
64+
dbFilename: 'sqlite.db',
65+
sqliteOptions: {
66+
encryptionKey: 'your-encryption-key'
67+
}
68+
});
69+
```
70+
4671
## Native Projects
4772

4873
This package uses native libraries. Create native Android and iOS projects (if not created already) by running:

0 commit comments

Comments
 (0)