Skip to content

Commit bd2db90

Browse files
authored
Merge pull request #26 from cipherstash/nextjs
docs: nexjs bundling config
2 parents ba87755 + cc47ff6 commit bd2db90

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Under the hood `jseql` uses CipherStash [Encrypt Query Language (EQL)](https://g
1515
- [Installation](#installation)
1616
- [Platform Support](#platform-support)
1717
- [Usage](#usage)
18+
- [Logging](#logging)
1819
- [Examples](#examples)
1920
- [CipherStash Client](#cipherstash-client)
2021
- [Contributing](#contributing)
@@ -456,6 +457,38 @@ JSEQL_LOG_LEVEL=info # Enable info logging
456457
JSEQL_LOG_LEVEL=error # Enable error logging
457458
```
458459

460+
## Builds and bundling
461+
462+
`@cipherstash/jseql` is a native Node.js module, and relies on native Node.js `require` to load the package.
463+
464+
### Next.js
465+
466+
Using `@cipherstash/jseql` with Next.js? You need to opt-out from the Server Components bundling and use native Node.js `require` instead.
467+
468+
#### Using version 15 or later
469+
470+
`next.config.ts` [configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/serverExternalPackages):
471+
472+
```js
473+
const nextConfig = {
474+
...
475+
serverExternalPackages: ['@cipherstash/jseql'],
476+
}
477+
```
478+
479+
#### Using version 14
480+
481+
`next.config.mjs` [configuration](https://nextjs.org/docs/14/app/api-reference/next-config-js/serverComponentsExternalPackages):
482+
483+
```js
484+
const nextConfig = {
485+
...
486+
experimental: {
487+
serverComponentsExternalPackages: ['@cipherstash/jseql'],
488+
},
489+
}
490+
```
491+
459492
## Examples
460493

461494
- [Basic example](/apps/basic)

0 commit comments

Comments
 (0)