@revturbine/sdk 0.11.8 → 0.11.10
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/CHANGELOG.md +65 -0
- package/dist/growthbook.d.ts +1 -1
- package/dist/headless.d.ts +604 -56
- package/dist/headless.js +2 -2
- package/dist/headless.js.map +1 -1
- package/dist/index.d.ts +604 -56
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/optimizely.d.ts +1 -1
- package/dist/types/web-sdk/customer-side.d.ts +67 -0
- package/dist/types/web-sdk/customer-side.d.ts.map +1 -1
- package/dist/types/web-sdk/trial-revision.d.ts +157 -0
- package/dist/types/web-sdk/trial-revision.d.ts.map +1 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -47,6 +47,71 @@ also require a changelog entry.
|
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
50
|
+
## 0.11.9
|
|
51
|
+
|
|
52
|
+
### The SDK can record app-owned trial revisions and evidenced account creation (BL-0237, plan 276 TASK-13)
|
|
53
|
+
|
|
54
|
+
**What changed.** Three new `@public` methods on `RevTurbineCustomerSdk` and the
|
|
55
|
+
matching capability on the Python and Rust ports:
|
|
56
|
+
|
|
57
|
+
| Method | Does |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `recordTrialRevision(episode, labels?)` | Classifies one trial episode's facts and emits one `trial_revision` if — and only if — the evidence supports a revision |
|
|
60
|
+
| `syncTrialRevisions(labels?)` | Does the same for every episode the registered `'trial'` domain provider states |
|
|
61
|
+
| `recordAccountCreated(payload)` | Emits `account_created` with plan 276 REQ-3 evidence; refuses a user-grain source |
|
|
62
|
+
|
|
63
|
+
**Trial execution and ownership stay with your app.** RevTurbine runs no trial,
|
|
64
|
+
enrols nobody, and decides nothing about when a trial ended. There is no
|
|
65
|
+
trial-enrollment service and no server-side evaluation. These methods *record*
|
|
66
|
+
the fact your app states, after running the same pure classifier every
|
|
67
|
+
RevTurbine port runs — so the fact that reaches the warehouse agrees with the
|
|
68
|
+
fact your app believes.
|
|
69
|
+
|
|
70
|
+
**The classifier reads no clock.** An episode whose scheduled end has merely
|
|
71
|
+
passed emits **nothing** and comes back `pending_unknown`. An elapsed deadline
|
|
72
|
+
proves only that the time passed, never that your app ended anything — supply
|
|
73
|
+
`actual_end_at` plus an `end_evidence` when it did. A conversion links only its
|
|
74
|
+
own episode's commitment, at or after that evidenced end, so card collection at
|
|
75
|
+
enrolment and unrelated paid activity cannot convert a trial. A usage-metered
|
|
76
|
+
episode needs exhaustion evidence before it can expire.
|
|
77
|
+
|
|
78
|
+
**The gentle nudge.** Registering no `'trial'` provider is a perfectly valid
|
|
79
|
+
integration: nothing breaks, no decision changes, every trial keeps working. But
|
|
80
|
+
trial revisions then go unrecorded, so the SDK logs **one** info-level console
|
|
81
|
+
line per runtime the first time trials exist and nothing will record them:
|
|
82
|
+
|
|
83
|
+
> `[RevTurbine] No trial provider supplied; trial revisions will not be recorded — see https://docs.revturbine.com/sdk/trials. Register a domain provider with domain: 'trial', or call recordTrialRevision(episode) yourself. Trials keep working; only the lifecycle facts are missing.`
|
|
84
|
+
|
|
85
|
+
It fires from `setTrialInstances()` (the moment your app hands the SDK trials)
|
|
86
|
+
and from `syncTrialRevisions()`. It is never a warning and never an error.
|
|
87
|
+
|
|
88
|
+
**Local mode.** In `local_only` the SDK makes no server calls at all, so a
|
|
89
|
+
recorded revision reaches any registered event consumer and never RevTurbine.
|
|
90
|
+
The result says `recorded_locally` rather than `recorded`, so an integrator can
|
|
91
|
+
tell the difference instead of assuming the warehouse has it.
|
|
92
|
+
|
|
93
|
+
**The ports.** `revturbine.core.trials.record_trial_revision` (Python) and
|
|
94
|
+
`revturbine::trial_revision::record_trial_revision` (Rust) classify an episode
|
|
95
|
+
and return the **validated payload for the host to ship** through its existing
|
|
96
|
+
ingest path. They emit nothing themselves: the server ports have never held an
|
|
97
|
+
event transport, and adding one would make each a second, unversioned ingest
|
|
98
|
+
client. What they guarantee is that the payload is byte-identical to the browser
|
|
99
|
+
SDK's for the same facts, asserted by the
|
|
100
|
+
`trial_revision_classification` cross-language parity fixture.
|
|
101
|
+
|
|
102
|
+
| field | value |
|
|
103
|
+
|---|---|
|
|
104
|
+
| Lands in | `0.11.9` |
|
|
105
|
+
| Fails closed in | n/a — additive. No existing call site changes behaviour. |
|
|
106
|
+
| Action needed | None to keep working. To record trial lifecycle facts, register a `'trial'` domain provider or call `recordTrialRevision` where your app changes a trial. |
|
|
107
|
+
| Proven by | `web-sdk/trial-revision.test.ts`, `tests/parity/fixtures/trial_revision_classification.json` (ts/py/rs), scaffold `src/trials/models/trial-revision.test.ts` |
|
|
108
|
+
|
|
109
|
+
Requires `@revt-eng/*` **0.1.352**, which adds the `trial_revision` taxonomy
|
|
110
|
+
name, the `TrialRevisionPayload` / `AccountCreatedPayload` contracts and the
|
|
111
|
+
`classifyTrialRevision` classifier.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
50
115
|
## 0.11.8
|
|
51
116
|
|
|
52
117
|
### `account_id` falls back to a PREFIXED user key instead of a bare user id (BL-0117)
|
package/dist/growthbook.d.ts
CHANGED
|
@@ -275,7 +275,7 @@ type TraitsNamespace = `traits:${string}`;
|
|
|
275
275
|
* The `traits` domain and any `traits:<namespace>` domain are merged
|
|
276
276
|
* into a single `traits` slot in `ResolvedProviderContext`.
|
|
277
277
|
*/
|
|
278
|
-
type DomainProviderName = 'plan' | 'entitlements' | 'segments' | 'experiments' | 'content' | 'rules' | 'traits' | 'theme' | 'events' | 'cta' | TraitsNamespace;
|
|
278
|
+
type DomainProviderName = 'plan' | 'entitlements' | 'segments' | 'experiments' | 'content' | 'rules' | 'traits' | 'theme' | 'events' | 'cta' | 'trial' | TraitsNamespace;
|
|
279
279
|
/** Immutable inputs available while resolving a domain provider. */
|
|
280
280
|
interface DomainProviderResolutionInput {
|
|
281
281
|
/** Current caller-supplied and trusted server-enriched context snapshot. */
|