securenow 7.0.0-anas.2 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
 
3
3
  This guide is for developers who want to add the `securenow` package to their applications to enable logging to SecureNow or any OTLP-compatible backend.
4
4
 
5
- **Since v5.6.0:** When `SECURENOW_LOGGING_ENABLED=1`, `console.log`, `console.warn`, `console.error`, `console.info`, and `console.debug` are **automatically** forwarded as OTLP log records after you load `securenow/register`. A separate `require('securenow/console-instrumentation')` is no longer required (the module remains for backward compatibility).
5
+ **Since v7.0.0:** Logging, body capture, and multipart capture are **on by default**. Credentials come from `.securenow/credentials.json` written by `npx securenow login` no env vars required for local dev. Set `SECURENOW_LOGGING_ENABLED=0` to disable logging if you don't want it.
6
6
 
7
7
  ---
8
8
 
@@ -10,30 +10,36 @@ This guide is for developers who want to add the `securenow` package to their ap
10
10
 
11
11
  ```bash
12
12
  npm install securenow
13
+ npx securenow login # pick/create your app in the browser
13
14
  ```
14
15
 
16
+ That's it for local dev. The `login` step writes `.securenow/credentials.json` (gitignored automatically) and the SDK reads it at boot.
17
+
18
+ For CI / Docker / production where you can't run the browser flow, set env vars — see "Step 1 (alternative)" below.
19
+
15
20
  ---
16
21
 
17
22
  ## Setup Steps
18
23
 
19
- ### Step 1: Configure Environment Variables
24
+ ### Step 1 (alternative) Environment variables for CI / Docker / prod
20
25
 
21
- Add these to your `.env` file or export them:
26
+ If `npx securenow login` isn't an option on the target machine, set:
22
27
 
23
28
  ```bash
24
- # Required: Enable logging
25
- SECURENOW_LOGGING_ENABLED=1
29
+ # App routing key (UUID) — from `npx securenow apps`
30
+ SECURENOW_APPID=your-app-key-uuid
26
31
 
27
- # Required: Your app name
28
- SECURENOW_APPID=my-app-name
32
+ # OTLP collector (defaults to https://freetrial.securenow.ai:4318)
33
+ SECURENOW_INSTANCE=https://freetrial.securenow.ai:4318
29
34
 
30
- # Required: Your OTLP endpoint
31
- SECURENOW_INSTANCE=http://your-otlp-collector:4318
32
-
33
- # For managed OTLP / authentication (optional):
35
+ # Optional defaults are already on:
36
+ # SECURENOW_LOGGING_ENABLED=0 # to disable console-log forwarding
37
+ # SECURENOW_CAPTURE_BODY=0 # to disable body capture (required for Fastify/Hapi/Hono)
34
38
  # OTEL_EXPORTER_OTLP_HEADERS="x-api-key=your-key"
35
39
  ```
36
40
 
41
+ Env vars always take precedence over the credentials file.
42
+
37
43
  ---
38
44
 
39
45
  ### Step 2: Choose Your Integration Method