@wellth-app/experiments 0.0.0-stage → 0.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.
Files changed (66) hide show
  1. package/README.md +223 -2
  2. package/dist/cjs/index.js +10 -0
  3. package/dist/cjs/index.js.map +1 -0
  4. package/dist/cjs/react.js +317 -0
  5. package/dist/cjs/react.js.map +1 -0
  6. package/dist/cjs/registry-pg5aaOm-.js +537 -0
  7. package/dist/cjs/registry-pg5aaOm-.js.map +1 -0
  8. package/dist/cjs/web.js +87 -0
  9. package/dist/cjs/web.js.map +1 -0
  10. package/dist/esm/index.js +3 -0
  11. package/dist/esm/index.js.map +1 -0
  12. package/dist/esm/react.js +290 -0
  13. package/dist/esm/react.js.map +1 -0
  14. package/dist/esm/registry-B73fwn9J.js +534 -0
  15. package/dist/esm/registry-B73fwn9J.js.map +1 -0
  16. package/dist/esm/web.js +85 -0
  17. package/dist/esm/web.js.map +1 -0
  18. package/dist/events.d.ts +65 -0
  19. package/dist/events.d.ts.map +1 -0
  20. package/dist/index.d.ts +10 -0
  21. package/dist/index.d.ts.map +1 -0
  22. package/dist/react/context.d.ts +37 -0
  23. package/dist/react/context.d.ts.map +1 -0
  24. package/dist/react/guard.d.ts +11 -0
  25. package/dist/react/guard.d.ts.map +1 -0
  26. package/dist/react/index.d.ts +12 -0
  27. package/dist/react/index.d.ts.map +1 -0
  28. package/dist/react/provider.d.ts +38 -0
  29. package/dist/react/provider.d.ts.map +1 -0
  30. package/dist/react/use-analytics.d.ts +12 -0
  31. package/dist/react/use-analytics.d.ts.map +1 -0
  32. package/dist/react/use-experiment-qa.d.ts +14 -0
  33. package/dist/react/use-experiment-qa.d.ts.map +1 -0
  34. package/dist/react/use-experiment.d.ts +30 -0
  35. package/dist/react/use-experiment.d.ts.map +1 -0
  36. package/dist/react/use-feature-flag.d.ts +16 -0
  37. package/dist/react/use-feature-flag.d.ts.map +1 -0
  38. package/dist/react/use-feature-value.d.ts +16 -0
  39. package/dist/react/use-feature-value.d.ts.map +1 -0
  40. package/dist/registry.d.ts +143 -0
  41. package/dist/registry.d.ts.map +1 -0
  42. package/dist/types.d.ts +111 -0
  43. package/dist/types.d.ts.map +1 -0
  44. package/dist/uuid.d.ts +6 -0
  45. package/dist/uuid.d.ts.map +1 -0
  46. package/dist/web/batched-event-sender.d.ts +35 -0
  47. package/dist/web/batched-event-sender.d.ts.map +1 -0
  48. package/dist/web/index.d.ts +7 -0
  49. package/dist/web/index.d.ts.map +1 -0
  50. package/package.json +127 -4
  51. package/src/events.ts +90 -0
  52. package/src/index.ts +37 -0
  53. package/src/react/context.ts +62 -0
  54. package/src/react/guard.ts +25 -0
  55. package/src/react/index.ts +17 -0
  56. package/src/react/provider.tsx +109 -0
  57. package/src/react/use-analytics.ts +17 -0
  58. package/src/react/use-experiment-qa.ts +26 -0
  59. package/src/react/use-experiment.ts +72 -0
  60. package/src/react/use-feature-flag.ts +35 -0
  61. package/src/react/use-feature-value.ts +42 -0
  62. package/src/registry.ts +715 -0
  63. package/src/types.ts +120 -0
  64. package/src/uuid.ts +14 -0
  65. package/src/web/batched-event-sender.ts +111 -0
  66. package/src/web/index.ts +9 -0
@@ -0,0 +1,85 @@
1
+ /**
2
+ * An EventStream that buffers events and flushes them in batches — the same
3
+ * stream every product event uses. Batches are best-effort: analytics events
4
+ * ride the network's happy path and a failed batch is dropped, never retried
5
+ * into a duplicate.
6
+ *
7
+ * This transport is the web flavor (document visibility + sendBeacon). Other
8
+ * runtimes supply their own transport through the `transport` option or their
9
+ * own EventStream entirely.
10
+ */
11
+ function createBatchedEventSender({
12
+ url,
13
+ authorization,
14
+ batchSize = 20,
15
+ flushIntervalMs = 5000,
16
+ transport = defaultTransport(url, authorization)
17
+ }) {
18
+ let queue = [];
19
+ let inFlight = false;
20
+ const flush = async () => {
21
+ if (inFlight || queue.length === 0) return;
22
+ const batch = queue;
23
+ queue = [];
24
+ inFlight = true;
25
+ try {
26
+ await transport(batch);
27
+ } catch {
28
+ // Best-effort stream: a dropped batch must never break the app.
29
+ } finally {
30
+ inFlight = false;
31
+ }
32
+ };
33
+ const onHide = () => {
34
+ void flush();
35
+ };
36
+ const onVisibilityChange = () => {
37
+ if (document.visibilityState === "hidden") onHide();
38
+ };
39
+ const timer = setInterval(() => {
40
+ void flush();
41
+ }, flushIntervalMs);
42
+ document.addEventListener("visibilitychange", onVisibilityChange);
43
+ window.addEventListener("pagehide", onHide);
44
+ return {
45
+ send(event) {
46
+ queue.push(event);
47
+ if (queue.length >= batchSize) void flush();
48
+ },
49
+ flush,
50
+ destroy() {
51
+ clearInterval(timer);
52
+ document.removeEventListener("visibilitychange", onVisibilityChange);
53
+ window.removeEventListener("pagehide", onHide);
54
+ queue = [];
55
+ },
56
+ pendingCount() {
57
+ return queue.length;
58
+ }
59
+ };
60
+ }
61
+ function defaultTransport(url, authorization) {
62
+ return async batch => {
63
+ const body = JSON.stringify(batch);
64
+ if (!authorization && document.visibilityState === "hidden") {
65
+ if (navigator.sendBeacon?.(url, new Blob([body], {
66
+ type: "application/json"
67
+ }))) {
68
+ return;
69
+ }
70
+ }
71
+ const headers = {
72
+ "Content-Type": "application/json"
73
+ };
74
+ if (authorization) headers.Authorization = authorization;
75
+ await fetch(url, {
76
+ method: "POST",
77
+ body,
78
+ headers,
79
+ keepalive: true
80
+ });
81
+ };
82
+ }
83
+
84
+ export { createBatchedEventSender };
85
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sources":["../../src/web/batched-event-sender.ts"],"sourcesContent":["import type { EventStream, StreamEvent } from \"../events\";\n\nexport interface BatchedEventSender extends EventStream {\n /** Push every queued event now. Best-effort: a failed batch is dropped. */\n flush(): Promise<void>;\n /** Stop the flush timer and drop anything still queued. */\n destroy(): void;\n /** Events queued but not yet flushed. */\n pendingCount(): number;\n}\n\ninterface BatchedEventSenderOptions {\n url: string;\n authorization?: string;\n /** Flush as soon as this many events are queued. Default 20. */\n batchSize?: number;\n /** Flush interval while the page is alive. Default 5000ms. */\n flushIntervalMs?: number;\n /**\n * Where a serialized batch goes. Defaults to sendBeacon while the page is\n * hidden (a mid-unload fetch can die) and a keepalive POST otherwise.\n */\n transport?: (batch: readonly StreamEvent[]) => Promise<void>;\n}\n\n/**\n * An EventStream that buffers events and flushes them in batches — the same\n * stream every product event uses. Batches are best-effort: analytics events\n * ride the network's happy path and a failed batch is dropped, never retried\n * into a duplicate.\n *\n * This transport is the web flavor (document visibility + sendBeacon). Other\n * runtimes supply their own transport through the `transport` option or their\n * own EventStream entirely.\n */\nexport function createBatchedEventSender({\n url,\n authorization,\n batchSize = 20,\n flushIntervalMs = 5000,\n transport = defaultTransport(url, authorization),\n}: BatchedEventSenderOptions): BatchedEventSender {\n let queue: StreamEvent[] = [];\n let inFlight = false;\n\n const flush = async (): Promise<void> => {\n if (inFlight || queue.length === 0) return;\n const batch = queue;\n queue = [];\n inFlight = true;\n try {\n await transport(batch);\n } catch {\n // Best-effort stream: a dropped batch must never break the app.\n } finally {\n inFlight = false;\n }\n };\n\n const onHide = (): void => {\n void flush();\n };\n const onVisibilityChange = (): void => {\n if (document.visibilityState === \"hidden\") onHide();\n };\n\n const timer = setInterval(() => {\n void flush();\n }, flushIntervalMs);\n document.addEventListener(\"visibilitychange\", onVisibilityChange);\n window.addEventListener(\"pagehide\", onHide);\n\n return {\n send(event: StreamEvent): void {\n queue.push(event);\n if (queue.length >= batchSize) void flush();\n },\n flush,\n destroy(): void {\n clearInterval(timer);\n document.removeEventListener(\"visibilitychange\", onVisibilityChange);\n window.removeEventListener(\"pagehide\", onHide);\n queue = [];\n },\n pendingCount(): number {\n return queue.length;\n },\n };\n}\n\nfunction defaultTransport(\n url: string,\n authorization?: string,\n): (batch: readonly StreamEvent[]) => Promise<void> {\n return async (batch) => {\n const body = JSON.stringify(batch);\n if (!authorization && document.visibilityState === \"hidden\") {\n if (navigator.sendBeacon?.(url, new Blob([body], { type: \"application/json\" }))) {\n return;\n }\n }\n const headers: Record<string, string> = { \"Content-Type\": \"application/json\" };\n if (authorization) headers.Authorization = authorization;\n await fetch(url, {\n method: \"POST\",\n body,\n headers,\n keepalive: true,\n });\n };\n}\n"],"names":["createBatchedEventSender","url","authorization","batchSize","flushIntervalMs","transport","defaultTransport","queue","inFlight","flush","length","batch","onHide","onVisibilityChange","document","visibilityState","timer","setInterval","addEventListener","window","send","event","push","destroy","clearInterval","removeEventListener","pendingCount","body","JSON","stringify","navigator","sendBeacon","Blob","type","headers","Authorization","fetch","method","keepalive"],"mappings":"AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,wBAAwBA,CAAC;EACvCC,GAAG;EACHC,aAAa;AACbC,EAAAA,SAAS,GAAG,EAAE;AACdC,EAAAA,eAAe,GAAG,IAAI;AACtBC,EAAAA,SAAS,GAAGC,gBAAgB,CAACL,GAAG,EAAEC,aAAa;AACtB,CAAC,EAAsB;EAChD,IAAIK,KAAoB,GAAG,EAAE;EAC7B,IAAIC,QAAQ,GAAG,KAAK;AAEpB,EAAA,MAAMC,KAAK,GAAG,YAA2B;AACvC,IAAA,IAAID,QAAQ,IAAID,KAAK,CAACG,MAAM,KAAK,CAAC,EAAE;IACpC,MAAMC,KAAK,GAAGJ,KAAK;AACnBA,IAAAA,KAAK,GAAG,EAAE;AACVC,IAAAA,QAAQ,GAAG,IAAI;IACf,IAAI;MACF,MAAMH,SAAS,CAACM,KAAK,CAAC;AACxB,IAAA,CAAC,CAAC,MAAM;AACN;AAAA,IAAA,CACD,SAAS;AACRH,MAAAA,QAAQ,GAAG,KAAK;AAClB,IAAA;EACF,CAAC;EAED,MAAMI,MAAM,GAAGA,MAAY;IACzB,KAAKH,KAAK,EAAE;EACd,CAAC;EACD,MAAMI,kBAAkB,GAAGA,MAAY;IACrC,IAAIC,QAAQ,CAACC,eAAe,KAAK,QAAQ,EAAEH,MAAM,EAAE;EACrD,CAAC;AAED,EAAA,MAAMI,KAAK,GAAGC,WAAW,CAAC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AEgC,OAAO,CAACC,aAAa,GAAGjC,aAAa;IACxD,MAAMkC,KAAK,CAACnC,GAAG,EAAE;AACfoC,MAAAA,MAAM,EAAE,MAAM;MACdV,IAAI;MACJO,OAAO;AACPI,MAAAA,SAAS,EAAE;AACb,KAAC,CAAC;EACJ,CAAC;AACH;;"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * The analytics stream the SDK emits into. One stream carries every product
3
+ * event; `experiment_exposed` is one event type on it. The stream is the seam
4
+ * where the platform's analytics pipeline plugs in.
5
+ */
6
+ /**
7
+ * The warehouse contract for an experiment exposure. Field names are contractual —
8
+ * the warehouse recomputes assignment from `experiment_id` + `subject` and joins
9
+ * exposures on them. Exactly one emission per render-visible assignment.
10
+ *
11
+ * `config_version` + `subject` let the warehouse recompute the cohort *as
12
+ * configured at exposure time*; `exposure_id` is the idempotency key the
13
+ * ingestion and warehouse dedupe layers key on; `override` marks QA-forced
14
+ * assignments that analysis drops by default.
15
+ */
16
+ /**
17
+ * The surfaces that emit exposure. Each app declares itself at registry
18
+ * construction — the app is "app", Atlas is "web", notifications dispatch is
19
+ * "notifications". Extend as new surfaces ship.
20
+ */
21
+ export type ExposureSurface = "app" | "web" | "notifications";
22
+ export interface ExperimentExposureEvent {
23
+ event: "experiment_exposed";
24
+ /** The experiment's key. */
25
+ experiment_id: string;
26
+ /** The assigned arm's key. */
27
+ variation_id: string;
28
+ /** The member id the assignment hashed on (normalized: trimmed, lowercased). */
29
+ subject: string;
30
+ /** The emitting surface, declared by the app. */
31
+ surface: ExposureSurface;
32
+ /** Epoch milliseconds, at render time. */
33
+ timestamp: number;
34
+ /**
35
+ * The registry config version the assignment was evaluated against — captured
36
+ * at evaluation time and carried on the exposure, never re-read at send time.
37
+ * Null when unknown.
38
+ */
39
+ config_version: string | null;
40
+ /** Idempotency key: one per unique assignment per session. */
41
+ exposure_id: string;
42
+ /** Present and true only when a QA-kind override produced the assignment. */
43
+ override?: true;
44
+ }
45
+ /** Any event on the product-analytics stream. ExperimentExposureEvent is one of these. */
46
+ export interface StreamEvent {
47
+ event: string;
48
+ /** Epoch milliseconds. */
49
+ timestamp: number;
50
+ }
51
+ /** Where events go. Batching and transport live behind this seam. */
52
+ export interface EventStream {
53
+ send: (event: StreamEvent) => void;
54
+ }
55
+ export declare function buildExperimentExposure({ experimentKey, subjectId, variant, surface, timestamp, configVersion, exposureId, override, }: {
56
+ experimentKey: string;
57
+ subjectId: string;
58
+ variant: string;
59
+ surface: ExposureSurface;
60
+ timestamp: number;
61
+ configVersion: string | null;
62
+ exposureId: string;
63
+ override?: boolean;
64
+ }): ExperimentExposureEvent;
65
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;;;;;GASG;AACH;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,KAAK,GAAG,eAAe,CAAC;AAE9D,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,4BAA4B;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,OAAO,EAAE,eAAe,CAAC;IACzB,0CAA0C;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,IAAI,CAAC;CACjB;AAED,0FAA0F;AAC1F,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qEAAqE;AACrE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACpC;AAED,wBAAgB,uBAAuB,CAAC,EACtC,aAAa,EACb,SAAS,EACT,OAAO,EACP,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,GACT,EAAE;IACD,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,eAAe,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG,uBAAuB,CAY1B"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @wellth-app/experiments — the core entry: deterministic local assignment,
3
+ * overrides, and the exposure contract. No React, no DOM. React apps also want
4
+ * `@wellth-app/experiments/react`; web apps batching to an HTTP intake also want
5
+ * `@wellth-app/experiments/web`.
6
+ */
7
+ export { buildExperimentExposure, type EventStream, type ExperimentExposureEvent, type ExposureSurface, type StreamEvent, } from "./events";
8
+ export { createFeatureRegistry, type EvaluateExperimentInput, type EvaluateFlagInput, type FlagEvaluation, type FlagSource, type FeatureRegistry, type KeyKind, type ExperimentStatus, type RegistryInitOptions, type RegistryPayload, } from "./registry";
9
+ export type { ExperimentAssignment, ExperimentContext, ExperimentParams, ExposureInput, KeyValueStorage, OverrideEntry, Overrides, QaPin, ResolvedAssignment, TargetingAttributes, } from "./types";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EACL,uBAAuB,EACvB,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,WAAW,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,qBAAqB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,oBAAoB,EACpB,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,aAAa,EACb,SAAS,EACT,KAAK,EACL,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
@@ -0,0 +1,37 @@
1
+ import type { FeatureRegistry } from "../registry";
2
+ import type { TargetingAttributes } from "../types";
3
+ /** A product event handed to the stream. The context stamps subject and timestamp. */
4
+ export interface ProductEventInput {
5
+ event: string;
6
+ [property: string]: unknown;
7
+ }
8
+ /**
9
+ * The registry as components see it: the full read/QA surface minus
10
+ * trackExposure. Exposure emission stays inside the package's hooks, so no
11
+ * component can hand-craft an event around the never-log guards.
12
+ */
13
+ export type ComponentRegistry = Omit<FeatureRegistry, "trackExposure">;
14
+ export interface ExperimentsContextValue {
15
+ registry: ComponentRegistry;
16
+ /** The session's subject — the member id assignments hash on. */
17
+ subjectId: string;
18
+ /** The session's targeting attributes; a call-site's context overrides these. */
19
+ attributes?: TargetingAttributes;
20
+ /** Send a product event on the same stream exposures ride. */
21
+ trackEvent: (input: ProductEventInput) => void;
22
+ }
23
+ export declare const ExperimentsContext: import("react").Context<ExperimentsContextValue | null>;
24
+ /**
25
+ * The real registry, trackExposure included — the internal channel the
26
+ * package's own hooks use. Deliberately not re-exported from the React entry,
27
+ * so the surface has no typed path to exposure emission.
28
+ */
29
+ export declare const InternalRegistryContext: import("react").Context<FeatureRegistry | null>;
30
+ /** The mounted experiments context. Throws when no ExperimentProvider is mounted. */
31
+ export declare function useExperiments(): ExperimentsContextValue;
32
+ /**
33
+ * The real registry for the package's own hooks (useExperiment's exposure
34
+ * emission). Throws when no ExperimentProvider is mounted.
35
+ */
36
+ export declare function useInternalRegistry(): FeatureRegistry;
37
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/react/context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAEpD,sFAAsF;AACtF,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,eAAe,EAAE,eAAe,CAAC,CAAC;AAEvE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB,iFAAiF;IACjF,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,8DAA8D;IAC9D,UAAU,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAChD;AAED,eAAO,MAAM,kBAAkB,yDAE9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,iDAEnC,CAAC;AAEF,qFAAqF;AACrF,wBAAgB,cAAc,IAAI,uBAAuB,CAMxD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,eAAe,CAQrD"}
@@ -0,0 +1,11 @@
1
+ import type { FeatureRegistry, KeyKind } from "../registry";
2
+ /**
3
+ * The misuse guard — dev-only. Experiments go through useExperiment, flags
4
+ * through the flag hooks; crossing them either renders a variant with no
5
+ * exposure (corrupting the experiment's counts) or reads an experiment as a
6
+ * flag. In development a crossed read throws a clear error at the call site.
7
+ * Production builds strip the check (the bundle pins NODE_ENV to
8
+ * "production") and keep the registry's documented fail-closed behavior.
9
+ */
10
+ export declare function assertHookKeyKind(registry: Pick<FeatureRegistry, "getKeyKind">, key: string, expected: KeyKind, hook: string): void;
11
+ //# sourceMappingURL=guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/react/guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC,EAC7C,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,OAAO,EACjB,IAAI,EAAE,MAAM,GACX,IAAI,CASN"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `@wellth-app/experiments/react` — the React surface: the provider and the
3
+ * hooks call sites use. Works anywhere React runs (web, React Native).
4
+ */
5
+ export { ExperimentsContext, useExperiments, type ComponentRegistry, type ExperimentsContextValue, type ProductEventInput, } from "./context";
6
+ export { ExperimentProvider, type ExperimentProviderProps } from "./provider";
7
+ export { useAnalytics } from "./use-analytics";
8
+ export { useExperiment } from "./use-experiment";
9
+ export { useExperimentQa } from "./use-experiment-qa";
10
+ export { useFeatureFlag } from "./use-feature-flag";
11
+ export { useFeatureValue } from "./use-feature-value";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,GACvB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { type ReactNode } from "react";
3
+ import type { EventStream, ExposureSurface } from "../events";
4
+ import { type RegistryPayload } from "../registry";
5
+ import type { KeyValueStorage, Overrides, TargetingAttributes } from "../types";
6
+ export interface ExperimentProviderProps {
7
+ /** The session's subject — the member id assignments hash on. */
8
+ subjectId: string;
9
+ /**
10
+ * The surface exposures are stamped with ("app" | "web" | "notifications").
11
+ * Required — each app declares itself.
12
+ */
13
+ surface: ExposureSurface;
14
+ /** Session targeting attributes (platform, program, appVersion, …). */
15
+ attributes?: TargetingAttributes;
16
+ /** The analytics pipeline exposures batch through. Unset = computed but not sent. */
17
+ events?: EventStream;
18
+ /** The assignment override map, bundled by the app. Default: no overrides. */
19
+ overrides?: Overrides;
20
+ /** Where the config cache persists (AsyncStorage on React Native). Default: platform localStorage or memory. */
21
+ cacheStorage?: KeyValueStorage;
22
+ /** Config endpoint credentials. Unset = disabled: control reads, no fetch. */
23
+ clientKey?: string;
24
+ apiHost?: string;
25
+ /** An already-available config payload to seed synchronously instead of fetching. */
26
+ payload?: RegistryPayload;
27
+ children: ReactNode;
28
+ }
29
+ /**
30
+ * Mounts the session's experiment registry once, after auth. A `payload` seeds
31
+ * the registry synchronously at construction, so the first paint already reads
32
+ * the real assignment; the fetch path initializes async and children render
33
+ * immediately against a still-initializing registry, which returns control
34
+ * defaults, so a variant never flashes ahead of the assignment. Without a
35
+ * client key nothing is fetched — the control experience.
36
+ */
37
+ export declare function ExperimentProvider({ subjectId, surface, attributes, events, overrides, cacheStorage, clientKey, apiHost, payload, children, }: ExperimentProviderProps): React.JSX.Element;
38
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAQhF,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,EAAE,eAAe,CAAC;IACzB,uEAAuE;IACvE,UAAU,CAAC,EAAE,mBAAmB,CAAC;IACjC,qFAAqF;IACrF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,gHAAgH;IAChH,YAAY,CAAC,EAAE,eAAe,CAAC;IAC/B,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qFAAqF;IACrF,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,SAAS,EACT,OAAO,EACP,UAAU,EACV,MAAM,EACN,SAAS,EACT,YAAY,EACZ,SAAS,EACT,OAAO,EACP,OAAO,EACP,QAAQ,GACT,EAAE,uBAAuB,qBAqDzB"}
@@ -0,0 +1,12 @@
1
+ import { type ProductEventInput } from "./context";
2
+ /**
3
+ * The session's product-analytics stream — the same stream experiment exposures
4
+ * ride. `track` stamps the subject and timestamp. `ready` is false until the
5
+ * experiment config finishes initializing, so callers can skip events that have
6
+ * no meaningful assignment context yet.
7
+ */
8
+ export declare function useAnalytics(): {
9
+ ready: boolean;
10
+ track: (input: ProductEventInput) => void;
11
+ };
12
+ //# sourceMappingURL=use-analytics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-analytics.d.ts","sourceRoot":"","sources":["../../src/react/use-analytics.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEnE;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI;IAC9B,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC3C,CAIA"}
@@ -0,0 +1,14 @@
1
+ import type { QaPin } from "../types";
2
+ /**
3
+ * The QA override surface, for the dev/debug menu: force a variant for the
4
+ * current subject and session. Pinned assignments render the pinned arm but are
5
+ * never recorded as exposure.
6
+ */
7
+ export declare function useExperimentQa(): {
8
+ pins: readonly QaPin[];
9
+ pin: (pin: QaPin) => void;
10
+ unpin: (input: {
11
+ experimentKey: string;
12
+ }) => void;
13
+ };
14
+ //# sourceMappingURL=use-experiment-qa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-experiment-qa.d.ts","sourceRoot":"","sources":["../../src/react/use-experiment-qa.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGtC;;;;GAIG;AACH,wBAAgB,eAAe,IAAI;IACjC,IAAI,EAAE,SAAS,KAAK,EAAE,CAAC;IACvB,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAC1B,KAAK,EAAE,CAAC,KAAK,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACnD,CAYA"}
@@ -0,0 +1,30 @@
1
+ import type { ExperimentAssignment, ExperimentContext } from "../types";
2
+ /**
3
+ * Read the experiment's assignment for the current subject:
4
+ *
5
+ * ```ts
6
+ * const { variant, params } = useExperiment("brick_wall");
7
+ * // variant: the assigned arm key from the experiment config
8
+ * // params: the configured parameter payload for the assigned arm
9
+ * ```
10
+ *
11
+ * Pass `context` to evaluate for a different subject or with extra targeting
12
+ * attributes; both default to the session's. Targeting gates eligibility before
13
+ * bucketing — a member who fails targeting gets the default arm with no
14
+ * exposure. The hash input is always the subject id.
15
+ *
16
+ * Exactly one exposure is recorded, when the assigned variant is actually
17
+ * rendered (post-commit) — never on compute, and never for a member who was
18
+ * bucketed but not shown the experience. Defaults, stopped experiments,
19
+ * targeting failures, and QA pins never emit exposure.
20
+ *
21
+ * With `exposure: "manual"` the hook instead returns a `markExposed` trigger —
22
+ * for call sites that evaluate now but render the experience later. Call it
23
+ * when the experience actually renders; it no-ops on an unexposed assignment.
24
+ *
25
+ * Misuse guard: calling this on a feature-flag key throws a clear error in
26
+ * development (flags go through useFeatureFlag/useFeatureValue); production
27
+ * reads fail closed to control.
28
+ */
29
+ export declare function useExperiment(experimentKey: string, context?: ExperimentContext): ExperimentAssignment;
30
+ //# sourceMappingURL=use-experiment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-experiment.d.ts","sourceRoot":"","sources":["../../src/react/use-experiment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIxE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,aAAa,CAC3B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,oBAAoB,CAoCtB"}
@@ -0,0 +1,16 @@
1
+ import type { ExperimentContext } from "../types";
2
+ /**
3
+ * Read a boolean feature flag for the current subject:
4
+ *
5
+ * ```ts
6
+ * const enabled = useFeatureFlag("dark_mode_checkout");
7
+ * ```
8
+ *
9
+ * Targeting conditions and percentage rollouts evaluate locally against the
10
+ * same deterministic hash the experiments use. Flags never log exposure. An
11
+ * unknown flag is off; an experiment key read here throws a clear error in
12
+ * development — experiments go through useExperiment, the exposure-aware path
13
+ * (production reads fail closed to the config's default).
14
+ */
15
+ export declare function useFeatureFlag(featureKey: string, context?: ExperimentContext): boolean;
16
+ //# sourceMappingURL=use-feature-flag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-feature-flag.d.ts","sourceRoot":"","sources":["../../src/react/use-feature-flag.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIlD;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,iBAAiB,GAC1B,OAAO,CAaT"}
@@ -0,0 +1,16 @@
1
+ import type { ExperimentContext } from "../types";
2
+ /**
3
+ * Read a valued feature flag (string/number/JSON remote config) for the current
4
+ * subject, falling back when the flag is unknown or has no value:
5
+ *
6
+ * ```ts
7
+ * const headline = useFeatureValue("checkout_headline", "Control headline");
8
+ * ```
9
+ *
10
+ * The fallback declares the flag's type. Flags never log exposure; an
11
+ * experiment key read here throws a clear error in development — experiments
12
+ * go through useExperiment, the exposure-aware path (production reads fail
13
+ * closed to the config's default).
14
+ */
15
+ export declare function useFeatureValue<T>(featureKey: string, fallback: T, context?: ExperimentContext): T;
16
+ //# sourceMappingURL=use-feature-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-feature-value.d.ts","sourceRoot":"","sources":["../../src/react/use-feature-value.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIlD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,CAAC,EACX,OAAO,CAAC,EAAE,iBAAiB,GAC1B,CAAC,CAmBH"}
@@ -0,0 +1,143 @@
1
+ import { type FeatureApiResponse, type FeatureResultSource } from "@growthbook/growthbook";
2
+ import { type EventStream, type ExposureSurface, type StreamEvent } from "./events";
3
+ import type { ExposureInput, KeyValueStorage, Overrides, QaPin, ResolvedAssignment, TargetingAttributes } from "./types";
4
+ /**
5
+ * The features-endpoint payload the registry consumes. This is the wire format of
6
+ * `<sdk-host>/api/features/<clientKey>` — the config the evaluation engine
7
+ * downloads once and then evaluates entirely locally.
8
+ */
9
+ export type RegistryPayload = FeatureApiResponse;
10
+ export interface RegistryInitOptions {
11
+ /** The SDK key identifying the environment's config on the features endpoint. */
12
+ clientKey?: string;
13
+ /** The SDK host. When absent, the evaluation client's built-in default host applies. */
14
+ apiHost?: string;
15
+ }
16
+ export interface EvaluateExperimentInput {
17
+ experimentKey: string;
18
+ subjectId: string;
19
+ attributes?: TargetingAttributes;
20
+ }
21
+ export interface EvaluateFlagInput {
22
+ featureKey: string;
23
+ subjectId: string;
24
+ attributes?: TargetingAttributes;
25
+ }
26
+ /** An experiment's remote start/stop. Anything not running is stopped. */
27
+ export type ExperimentStatus = "running" | "stopped";
28
+ /**
29
+ * A config key's shape, for the hooks' misuse guard. "experiment" keys carry
30
+ * an experiment-shaped rule (live or not); "flag" keys carry flag-shaped
31
+ * rules. A bare-default key reports "unknown": a stopped experiment and a
32
+ * static default are indistinguishable, and both read fail-closed from either
33
+ * path, so no guard fires.
34
+ */
35
+ export type KeyKind = "experiment" | "flag" | "unknown";
36
+ /**
37
+ * How a flag resolved. The evaluation engine's source vocabulary, re-exported
38
+ * under our name: "force" (a targeting/rollout rule matched), "defaultValue"
39
+ * (no rule matched), "unknownFeature" (absent from the config), and the rarer
40
+ * engine outcomes.
41
+ */
42
+ export type FlagSource = FeatureResultSource;
43
+ /** A feature flag's resolution for one subject. Flags never log exposure. */
44
+ export interface FlagEvaluation {
45
+ /** The flag's resolved value — rule value, or the config's default. */
46
+ value: unknown;
47
+ /** Boolean convenience over the value. */
48
+ on: boolean;
49
+ off: boolean;
50
+ source: FlagSource;
51
+ }
52
+ export interface FeatureRegistry {
53
+ /**
54
+ * Fetch the experiment config from the features endpoint and start keeping it
55
+ * fresh. The evaluation client caches locally and revalidates stale reads in
56
+ * the background; init resolves with the cached config when one exists. Without
57
+ * a client key the registry stays disabled: every experiment reads control,
58
+ * every flag reads its fallback, and nothing is fetched. A failed fetch leaves
59
+ * the registry serving defaults, never throwing into the app.
60
+ */
61
+ init: (options: RegistryInitOptions) => Promise<void>;
62
+ /** Seed the registry synchronously from an already-available payload (tests, SSR). */
63
+ initSync: (options: {
64
+ payload: RegistryPayload;
65
+ }) => void;
66
+ /**
67
+ * Re-fetch the config now (e.g. on app foreground). No-op on a disabled or
68
+ * payload-seeded registry — a seeded registry is fresh by construction and
69
+ * has no endpoint to refresh from.
70
+ */
71
+ refresh: () => Promise<void>;
72
+ /**
73
+ * Resolve the assignment for one subject. The evaluation order: a stopped or
74
+ * unknown experiment reads control with no exposure (overrides never
75
+ * resurrect it); then, checked before delegating to the engine's local
76
+ * evaluation — QA pin, then registry overrides (migration / QA, unexpired
77
+ * only); then the engine (targeting conditions, then the deterministic hash
78
+ * bucket). Subject ids are normalized (trim + lowercase) inside the
79
+ * evaluator.
80
+ */
81
+ evaluateExperiment: (input: EvaluateExperimentInput) => ResolvedAssignment;
82
+ /**
83
+ * Resolve a feature flag for one subject: targeting conditions and percentage
84
+ * rollouts evaluate locally against the same deterministic hash. Flags never
85
+ * log exposure. An experiment-shaped key read here returns the config's
86
+ * default by design — experiments go through evaluateExperiment, which is the
87
+ * exposure-aware path.
88
+ */
89
+ evaluateFlag: (input: EvaluateFlagInput) => FlagEvaluation;
90
+ /**
91
+ * Record that an assignment became visible. Emits exactly one event per unique
92
+ * (experiment, subject, variant) assignment per session — repeat calls for the
93
+ * same assignment are deduplicated.
94
+ */
95
+ trackExposure: (input: ExposureInput) => void;
96
+ /** Send an event on the configured stream. No-op when no stream is configured. */
97
+ sendEvent: (event: StreamEvent) => void;
98
+ /** Force a variant for one subject on this session. Pins never emit exposure. */
99
+ pin: (pin: QaPin) => void;
100
+ unpin: (input: {
101
+ experimentKey: string;
102
+ }) => void;
103
+ getPins: () => readonly QaPin[];
104
+ /**
105
+ * The key's config shape, for the hooks' misuse guard: "experiment" when it
106
+ * carries an experiment-shaped rule (live or not), "flag" when it carries
107
+ * flag-shaped rules only, "unknown" otherwise (no config, or a bare default
108
+ * — indistinguishable from a stopped experiment, so no guard fires).
109
+ */
110
+ getKeyKind: (key: string) => KeyKind;
111
+ /** React subscription: re-render when the config or pins change. */
112
+ subscribe: (listener: () => void) => () => void;
113
+ getVersion: () => number;
114
+ /** True once a config payload is loaded and evaluations reflect it. */
115
+ isReady: () => boolean;
116
+ /** True when the registry was given a client key (evaluations are live config). */
117
+ isEnabled: () => boolean;
118
+ /** The loaded config's version (the payload's dateUpdated), null when unknown. */
119
+ getConfigVersion: () => string | null;
120
+ destroy: () => void;
121
+ }
122
+ interface FeatureRegistryOptions {
123
+ /**
124
+ * The surface exposures are stamped with. Required — each app declares
125
+ * itself; there is no default.
126
+ */
127
+ surface: ExposureSurface;
128
+ events?: EventStream;
129
+ overrides?: Overrides;
130
+ /**
131
+ * Where the config cache persists (AsyncStorage on React Native). Unset, the
132
+ * engine uses the platform's localStorage when present and memory otherwise.
133
+ */
134
+ cacheStorage?: KeyValueStorage;
135
+ /**
136
+ * Where config-guard warnings go: an experiment rule that breaks the platform
137
+ * contract fails closed and names its feature key here. Default: console.warn.
138
+ */
139
+ warn?: (message: string) => void;
140
+ }
141
+ export declare function createFeatureRegistry(options: FeatureRegistryOptions): FeatureRegistry;
142
+ export {};
143
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EAGvB,KAAK,mBAAmB,EAEzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAClB,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