@trafficwar/node 2.2.3 → 2.2.4
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.
- package/README.md +19 -0
- package/dist/index.cjs +739 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +735 -65
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -89,6 +89,21 @@ const trafficwar = new TrafficWar({
|
|
|
89
89
|
});
|
|
90
90
|
```
|
|
91
91
|
|
|
92
|
+
Set `verbose: true` to print, once at startup, every `event` and `label` the
|
|
93
|
+
SDK can see statically in `capture()` calls under the working directory (or
|
|
94
|
+
`catalogRoot`). String literals are printed as written. A present value that
|
|
95
|
+
is not a static string is printed as `<dynamic>`, and a missing one as
|
|
96
|
+
`<missing>`. The scan skips `node_modules` and does not print payloads, API
|
|
97
|
+
keys, or other properties. A scan failure is logged and does not stop the
|
|
98
|
+
client.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
const trafficwar = new TrafficWar({
|
|
102
|
+
apiKey: process.env.TRAFFICWAR_API_KEY!,
|
|
103
|
+
verbose: true,
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
92
107
|
The SDK generates a process-monotonic RFC 9562 UUIDv7 `event_id` for each event
|
|
93
108
|
that omits one. A caller may override it with any valid UUID. Caller-owned
|
|
94
109
|
objects are never modified.
|
|
@@ -322,6 +337,10 @@ delivery still fails.
|
|
|
322
337
|
- `baseUrl`: ingest origin. Defaults to `https://ingest.trafficwar.tech`.
|
|
323
338
|
- `debug`: print safe batch lifecycle diagnostics with `console.debug`.
|
|
324
339
|
Defaults to `false`.
|
|
340
|
+
- `verbose`: at startup, statically scan source for `capture()` calls and
|
|
341
|
+
print each `event` and `label`. Defaults to `false`.
|
|
342
|
+
- `catalogRoot`: directory scanned when `verbose` is true. Defaults to the
|
|
343
|
+
process working directory.
|
|
325
344
|
- `timeoutMs`: timeout for each attempt. Defaults to 30,000 ms, safely above
|
|
326
345
|
TrafficWar's 10-second durable acknowledgement window.
|
|
327
346
|
- `maxRetries`: retries after the first attempt. Defaults to 3.
|