@vesta-analytics/sdk 0.1.0 → 0.1.1
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 +2 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# @vesta-analytics/sdk (TypeScript)
|
|
2
2
|
|
|
3
3
|
Customer-installable SDK. One call instruments an MCP server and ships
|
|
4
|
-
behavioural data to Vesta over OTLP/HTTP
|
|
5
|
-
Python `vesta-analytics`, so SDK-emitted rows land in `raw.spans` indistinguishable
|
|
6
|
-
from any other producer.
|
|
4
|
+
behavioural data to Vesta over OTLP/HTTP.
|
|
7
5
|
|
|
8
6
|
```bash
|
|
9
7
|
npm install @vesta-analytics/sdk
|
|
@@ -15,8 +13,7 @@ instrument(server, { apiKey: 'vsk_...' });
|
|
|
15
13
|
```
|
|
16
14
|
|
|
17
15
|
Runs inside the customer's process — minimal footprint, fail-open, never breaks
|
|
18
|
-
the host server.
|
|
19
|
-
test with `npm test` (vitest).
|
|
16
|
+
the host server.
|
|
20
17
|
|
|
21
18
|
## What it supports
|
|
22
19
|
|
|
@@ -50,30 +47,6 @@ instrument(server, {
|
|
|
50
47
|
Add the call **after tools are registered and before you serve** — the adapter
|
|
51
48
|
skips wrapping a method whose handler is not registered yet.
|
|
52
49
|
|
|
53
|
-
## Parity with the Python SDK
|
|
54
|
-
|
|
55
|
-
This is a structural 1:1 port of `packages/vesta-sdk`. The framework-free core
|
|
56
|
-
(`capture`, `redaction`, `propagation`, `dimensions`, `export`, `diagnostics`)
|
|
57
|
-
mirrors the Python modules, and the wire output is produced by the OpenTelemetry
|
|
58
|
-
JS SDK + OTLP-proto-HTTP exporter, matching Python's OTLP/protobuf bytes.
|
|
59
|
-
|
|
60
|
-
Spans are deliberately distinguishable by producing SDK: the TypeScript SDK
|
|
61
|
-
stamps `agent_runtime = "vesta-sdk-js"` (the Python SDK uses `"vesta-sdk"`),
|
|
62
|
-
following the existing `vesta-<runtime>` convention. Everything else — columns,
|
|
63
|
-
payload encoding, `source_kind="sdk"` — is identical, so analyses that don't
|
|
64
|
-
care about language treat the rows the same.
|
|
65
|
-
|
|
66
|
-
Two intentional differences from Python:
|
|
67
|
-
|
|
68
|
-
- **Session id is real.** The official TS SDK hands the request handler an
|
|
69
|
-
`extra.sessionId` (transport session id), used directly. Python had no stable
|
|
70
|
-
session id and fell back to `id(session)`. A missing id still resolves
|
|
71
|
-
dimensions fresh per call (the cross-user privacy invariant).
|
|
72
|
-
- **`hash` redaction matches for common scalars only.** The action hashes
|
|
73
|
-
`sha256(pythonRepr(value))[:16]`; `pythonRepr` replicates Python's `repr()`
|
|
74
|
-
for strings/numbers/bools/null (verified against ground-truth digests), so
|
|
75
|
-
hashes agree cross-SDK for typical PII. Exotic types may diverge.
|
|
76
|
-
|
|
77
50
|
## Shutdown / stdio delivery
|
|
78
51
|
|
|
79
52
|
`instrument()` installs a bounded flush on process shutdown: it hooks
|