@capxul/sdk 1.2.2 → 1.2.3
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 +18 -20
- package/dist/{create-capxul-client-DVzm78RU.mjs → create-capxul-client-BTnlLLag.mjs} +462 -66
- package/dist/create-capxul-client-BTnlLLag.mjs.map +1 -0
- package/dist/{create-capxul-client-C7H5b68l.d.mts → create-capxul-client-BxTtXho7.d.mts} +287 -285
- package/dist/create-capxul-client-BxTtXho7.d.mts.map +1 -0
- package/dist/index.d.mts +29 -78
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +131 -405
- package/dist/index.mjs.map +1 -1
- package/dist/node/index.d.mts +1 -1
- package/dist/{signer-CJT0pPiO.d.mts → signer-DgWAmtmi.d.mts} +2 -3
- package/dist/{signer-CJT0pPiO.d.mts.map → signer-DgWAmtmi.d.mts.map} +1 -1
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.mjs +1 -1
- package/package.json +4 -4
- package/dist/create-capxul-client-C7H5b68l.d.mts.map +0 -1
- package/dist/create-capxul-client-DVzm78RU.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -19,32 +19,30 @@ const client = created.value;
|
|
|
19
19
|
Every public operation resolves a `Promise<CapxulResult<T>>`. Domain failures
|
|
20
20
|
are values, not thrown exceptions.
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Observability
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
Hosts can attach the PostHog client they already initialized through one
|
|
25
|
+
product-and-failure module:
|
|
26
26
|
|
|
27
27
|
```ts
|
|
28
|
+
import { postHogObservability } from "@capxul/sdk";
|
|
29
|
+
|
|
28
30
|
const created = await createCapxulClient({
|
|
29
31
|
publishableKey: "cap_pk_…",
|
|
30
|
-
|
|
31
|
-
host: "https://us.i.posthog.com",
|
|
32
|
-
headers: { Authorization: "Bearer phc_…" },
|
|
32
|
+
observability: postHogObservability(posthog, {
|
|
33
33
|
capxulEnv: "production",
|
|
34
|
-
|
|
35
|
-
},
|
|
34
|
+
context: () => ({ correlationId, journeyId, organizationId }),
|
|
35
|
+
}),
|
|
36
36
|
});
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
HTTP 200 is not delivery proof: verify a live run by querying both PostHog
|
|
47
|
-
`logs` and `posthog.trace_spans` for the same fresh trace.
|
|
39
|
+
The SDK initializes no analytics client and preserves host consent. Product
|
|
40
|
+
events and sanitized failures share one enable/context/delivery policy.
|
|
41
|
+
Engineering logs and traces are separate internally, but applications do not
|
|
42
|
+
configure them: the versioned bootstrap response optionally supplies the
|
|
43
|
+
governed PostHog ingest origin, public project token, and environment. The SDK
|
|
44
|
+
derives endpoints, service, producer, and version. Missing or invalid policy
|
|
45
|
+
disables engineering export without failing client creation.
|
|
48
46
|
|
|
49
47
|
Onboarding uses explicit domain objects. Personal completion accepts
|
|
50
48
|
`{ profile }`; Organization completion accepts independently validated
|
|
@@ -60,7 +58,7 @@ Public Profile reads include the durable `onboarded` flag and optional
|
|
|
60
58
|
The packed npm package exposes only:
|
|
61
59
|
|
|
62
60
|
- `@capxul/sdk` — the client factory, public method and value types, signers,
|
|
63
|
-
and
|
|
61
|
+
and the host observability helper.
|
|
64
62
|
- `@capxul/sdk/node` — Node-only signer and runtime helpers.
|
|
65
63
|
- `@capxul/sdk/testing` — the real identity runtime assembled over
|
|
66
64
|
deterministic in-memory ports, with OTP, advance-only clock, transition,
|
|
@@ -96,8 +94,8 @@ The testing entry is identity-scoped and hermetic. Fine-grained
|
|
|
96
94
|
evidence, and update triggers.
|
|
97
95
|
- [Architecture](./docs/architecture.md) — client assembly, flows, ports,
|
|
98
96
|
adapters, and proof map.
|
|
99
|
-
- [Observation](./docs/observation.md) — host
|
|
100
|
-
bounded backend linkage.
|
|
97
|
+
- [Observation](./docs/observation.md) — unified host observability,
|
|
98
|
+
bootstrap-owned engineering policy, and bounded backend linkage.
|
|
101
99
|
- [Public SDK documentation](../../apps/docs/content/docs/sdk/index.mdx) —
|
|
102
100
|
tutorials, guides, reference, and explanation for npm consumers.
|
|
103
101
|
|