Skip to content

Commit

Permalink
Merge pull request #26 from cipherstash/nextjs
Browse files Browse the repository at this point in the history
docs: nexjs bundling config
  • Loading branch information
calvinbrewer authored Jan 21, 2025
2 parents ba87755 + cc47ff6 commit bd2db90
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Under the hood `jseql` uses CipherStash [Encrypt Query Language (EQL)](https://g
- [Installation](#installation)
- [Platform Support](#platform-support)
- [Usage](#usage)
- [Logging](#logging)
- [Examples](#examples)
- [CipherStash Client](#cipherstash-client)
- [Contributing](#contributing)
Expand Down Expand Up @@ -456,6 +457,38 @@ JSEQL_LOG_LEVEL=info # Enable info logging
JSEQL_LOG_LEVEL=error # Enable error logging
```

## Builds and bundling

`@cipherstash/jseql` is a native Node.js module, and relies on native Node.js `require` to load the package.

### Next.js

Using `@cipherstash/jseql` with Next.js? You need to opt-out from the Server Components bundling and use native Node.js `require` instead.

#### Using version 15 or later

`next.config.ts` [configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/serverExternalPackages):

```js
const nextConfig = {
...
serverExternalPackages: ['@cipherstash/jseql'],
}
```

#### Using version 14

`next.config.mjs` [configuration](https://nextjs.org/docs/14/app/api-reference/next-config-js/serverComponentsExternalPackages):

```js
const nextConfig = {
...
experimental: {
serverComponentsExternalPackages: ['@cipherstash/jseql'],
},
}
```

## Examples

- [Basic example](/apps/basic)
Expand Down

0 comments on commit bd2db90

Please sign in to comment.