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
> The `--env-file` flag cannot be used in `NODE_OPTIONS`.
33
33
34
+
## Use Zen together with Sentry (ESM)
35
+
36
+
You need to use Node.js v24.11.1 / v25.1.0 or later to use Zen together with Sentry in an ESM application.
37
+
Follow the [Sentry instructions for ESM](https://docs.sentry.io/platforms/javascript/guides/node/install/esm/) to set up Sentry. After that, add the Zen import inside the `instrument.mjs` file as shown below.
38
+
39
+
```js
40
+
import"@aikidosec/firewall/instrument";
41
+
import*asSentryfrom"@sentry/node";
42
+
43
+
Sentry.init({
44
+
// ...
45
+
});
46
+
```
47
+
48
+
Import the `instrument.mjs` file using the `--import` flag when starting your application. The `-r @aikidosec/firewall/instrument` CLI flag is not needed in this case.
49
+
50
+
```sh
51
+
node --import ./instrument.mjs your-app.js
52
+
```
53
+
34
54
## Known issues
35
55
36
56
- Zen can not protect ESM sub-dependencies of an ESM package. For example if an ESM package `foo` imports a sub-dependency `bar` that is also an ESM package, Zen will not be able to protect the code in `bar`. This is because the V8 engine does not allow Node.js to observe the evaluation of inner ESM packages (yet). Open issue: [Adding an evaluation hook for v8::Module](https://issues.chromium.org/u/1/issues/384413088). See a full example below.
0 commit comments