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
In the meantime checkout the [EQL repo](https://github.com/cipherstash/encrypt-query-language) which is where these docs will get their inspiration from specifically for JavaScript/TypeScript implementations.
Copy file name to clipboardExpand all lines: packages/protect/README.md
+31-19Lines changed: 31 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,7 @@ yarn add @cipherstash/protect
94
94
pnpm add @cipherstash/protect
95
95
```
96
96
97
-
> [!TIP]
97
+
> [!TIP]
98
98
> [Bun](https://bun.sh/) is not currently supported due to a lack of [Node-API compatibility](https://github.com/oven-sh/bun/issues/158). Under the hood, Protect.js uses [CipherStash Client](#cipherstash-client) which is written in Rust and embedded using [Neon](https://github.com/neon-bindings/neon).
99
99
100
100
Lastly, install the CipherStash CLI:
@@ -111,7 +111,7 @@ Lastly, install the CipherStash CLI:
111
111
112
112
### Opt-out of bundling
113
113
114
-
> [!IMPORTANT]
114
+
> [!IMPORTANT]
115
115
> **You need to opt-out of bundling when using Protect.js.**
116
116
117
117
Protect.js uses Node.js specific features and requires the use of the [native Node.js `require`](https://nodejs.org/api/modules.html#requireid).
@@ -122,9 +122,8 @@ Read more about [building and bundling with Protect.js](#builds-and-bundling).
122
122
123
123
## Getting started
124
124
125
-
🆕 **Existing app?** Skip to [the next step](#configuration).
126
-
127
-
🌱 **Clean slate?** Check out the [getting started tutorial](./docs/getting-started.md).
125
+
- 🆕 **Existing app?** Skip to [the next step](#configuration).
126
+
- 🌱 **Clean slate?** Check out the [getting started tutorial](./docs/getting-started.md).
@@ -313,7 +310,7 @@ The `decryptResult` will return one of the following:
313
310
314
311
### Working with models and objects
315
312
316
-
Protect.js provides model-level encryption methods that make it easy to encrypt and decrypt entire objects.
313
+
Protect.js provides model-level encryption methods that make it easy to encrypt and decrypt entire objects.
317
314
These methods automatically handle the encryption of fields defined in your schema.
318
315
319
316
If you are working with a large data set, the model operations are significantly faster than encrypting and decrypting individual objects as they are able to perform bulk operations.
The `encryptModel` function will only encrypt fields that are defined in your schema.
354
+
The `encryptModel` function will only encrypt fields that are defined in your schema.
358
355
Other fields (like `id` and `createdAt` in the example above) will remain unchanged.
359
356
360
357
#### Type safety with models
361
358
362
-
Protect.js provides strong TypeScript support for model operations.
359
+
Protect.js provides strong TypeScript support for model operations.
363
360
You can specify your model's type to ensure end-to-end type safety:
364
361
365
362
```typescript
@@ -523,7 +520,7 @@ if (decryptedResult.failure) {
523
520
const decryptedUsers =decryptedResult.data;
524
521
```
525
522
526
-
The model encryption methods provide a higher-level interface that's particularly useful when working with ORMs or when you need to encrypt multiple fields in an object.
523
+
The model encryption methods provide a higher-level interface that's particularly useful when working with ORMs or when you need to encrypt multiple fields in an object.
527
524
They automatically handle the mapping between your model's structure and the encrypted fields defined in your schema.
528
525
529
526
### Store encrypted data in a database
@@ -549,21 +546,36 @@ To enable searchable encryption in PostgreSQL, [install the EQL custom types and
0 commit comments