@revturbine/sdk 0.10.7 → 0.10.8
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 +44 -0
- package/dist/headless.d.ts +23 -0
- package/dist/headless.js +2 -2
- package/dist/headless.js.map +1 -1
- package/dist/index.d.ts +23 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/types/web-sdk/customer-side.d.ts +23 -0
- package/dist/types/web-sdk/customer-side.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -47,6 +47,50 @@ also require a changelog entry.
|
|
|
47
47
|
|
|
48
48
|
---
|
|
49
49
|
|
|
50
|
+
## 0.10.8
|
|
51
|
+
|
|
52
|
+
### `{{recommended_plan_name}}` and `{{plan_name}}` no longer reach end users as raw tokens (BL-0121)
|
|
53
|
+
|
|
54
|
+
**What changed.** The placement-decision lane now substitutes the five tokens
|
|
55
|
+
the SDK resolves from the Playbook — `plan_name`, `plan_price`,
|
|
56
|
+
`upgrade_plan_price`, `recommended_plan_handle`, `recommended_plan_name` —
|
|
57
|
+
into `RevTurbinePlacementDecision.content` (and the mirrored
|
|
58
|
+
`decision.output.content`). It previously substituted `plan_price` and
|
|
59
|
+
`upgrade_plan_price` only.
|
|
60
|
+
|
|
61
|
+
`recommended_plan_handle` / `recommended_plan_name` were already derived, by
|
|
62
|
+
the parity-locked `resolveRecommendedPlanTokens` dispatch, and already readable
|
|
63
|
+
via `getPersonalizationTokens()`. Nothing wrote them into rendered content, so
|
|
64
|
+
a placement authored with `"Upgrade to {{recommended_plan_name}}"` shipped the
|
|
65
|
+
literal braces to the end user. Observed on the CybeDefend demo, 2026-09-22.
|
|
66
|
+
|
|
67
|
+
Two properties of the substitution are deliberate:
|
|
68
|
+
|
|
69
|
+
| input | result |
|
|
70
|
+
|---|---|
|
|
71
|
+
| a token the SDK owns but cannot resolve (top-of-ladder user has no next plan) | empty string — the spec's documented empty-token convention |
|
|
72
|
+
| a token the SDK does not own (`{{usage_percent}}`, an app-defined token) | left verbatim, so the React render lane still resolves it |
|
|
73
|
+
|
|
74
|
+
`plan_name` resolves through the plan's `unique_handle`, the matching identity
|
|
75
|
+
— the lookup used to be handed the plan *object*, which by design resolves
|
|
76
|
+
nothing, so `{{plan_name}}` rendered raw for every user identified by
|
|
77
|
+
`plan_handle`.
|
|
78
|
+
|
|
79
|
+
**Landed in.** `0.10.8`.
|
|
80
|
+
|
|
81
|
+
**Not fixed here.** `{{upgrade_plan_price}}` still renders the ANNUAL amount
|
|
82
|
+
for a plan that has both an annual and a monthly variation. Variation
|
|
83
|
+
preference keys off the user's billing cadence, but no supported input carries
|
|
84
|
+
it (`billing_period` is absent from `UserContextSchema` and from the recognized
|
|
85
|
+
`identify()` / `update()` keys), so selection falls through to the
|
|
86
|
+
alphabetically-first variation and `<plan>_annual` always wins. Closing it
|
|
87
|
+
needs a schema field for the cadence and a contract for which period the token
|
|
88
|
+
reflects when the cadence is unknown; both are open on BL-0121.
|
|
89
|
+
|
|
90
|
+
**Proving test.** `web-sdk/customer-side-upgrade-tokens.test.ts`.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
50
94
|
## 0.10.7
|
|
51
95
|
|
|
52
96
|
### The Python and Rust ports stop filtering payloads on `status` (BL-0151)
|
package/dist/headless.d.ts
CHANGED
|
@@ -21140,6 +21140,29 @@ declare class RevTurbineCustomerSdk {
|
|
|
21140
21140
|
getEligibleAddons(): Promise<EligibleAddon[]>;
|
|
21141
21141
|
private formatEligiblePrice;
|
|
21142
21142
|
private priceTokensForProviders;
|
|
21143
|
+
/**
|
|
21144
|
+
* The plan-and-recommendation token family the SDK resolves authoritatively
|
|
21145
|
+
* from the Playbook, for substitution into decision content.
|
|
21146
|
+
*
|
|
21147
|
+
* These five are exactly the tokens whose values come from the Playbook's
|
|
21148
|
+
* plan catalogue plus the recommendation strategy, so the SDK — not the
|
|
21149
|
+
* host app — is the only thing that can fill them in. Every other token in
|
|
21150
|
+
* the studio table (usage, trial, seats, credits) is resolved on the React
|
|
21151
|
+
* render lane by `derivePlacementPersonalizationTokens`, which unknown
|
|
21152
|
+
* tokens pass through untouched.
|
|
21153
|
+
*/
|
|
21154
|
+
private derivedContentTokens;
|
|
21155
|
+
/**
|
|
21156
|
+
* Substitute the SDK-resolved plan/price/recommendation tokens into a
|
|
21157
|
+
* decision's content.
|
|
21158
|
+
*
|
|
21159
|
+
* Only the tokens in {@link derivedContentTokens} are substituted; any
|
|
21160
|
+
* other `{{token}}` is left verbatim so the render lane (or the host app)
|
|
21161
|
+
* can still resolve it. A token the SDK owns but cannot resolve — a
|
|
21162
|
+
* top-of-ladder user has no recommended plan — becomes an empty string,
|
|
21163
|
+
* which is the spec's documented empty-token convention and is what keeps
|
|
21164
|
+
* raw `{{...}}` braces off the end user's screen.
|
|
21165
|
+
*/
|
|
21143
21166
|
private applyPriceTokens;
|
|
21144
21167
|
/**
|
|
21145
21168
|
* Return current SDK policy snapshot.
|