@encorekit/web-sdk 1.1.21 → 2.0.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.
Files changed (52) hide show
  1. package/README.md +190 -46
  2. package/dist/cjs/index.cjs +1 -1
  3. package/dist/cjs/index.cjs.map +1 -1
  4. package/dist/esm/index.js +1 -1
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/umd/encore.min.js +1 -1
  7. package/dist/umd/encore.min.js.map +1 -1
  8. package/package.json +4 -3
  9. package/types/analytics/AnalyticsClient.d.ts +11 -1
  10. package/types/analytics/AnalyticsClient.d.ts.map +1 -1
  11. package/types/analytics/events.d.ts +192 -19
  12. package/types/analytics/events.d.ts.map +1 -1
  13. package/types/analytics/transport.d.ts.map +1 -1
  14. package/types/api/APIClient.d.ts +36 -7
  15. package/types/api/APIClient.d.ts.map +1 -1
  16. package/types/api/generated/types.d.ts +548 -1
  17. package/types/api/generated/types.d.ts.map +1 -1
  18. package/types/api/models.d.ts +8 -3
  19. package/types/api/models.d.ts.map +1 -1
  20. package/types/core/Configuration.d.ts +0 -4
  21. package/types/core/Configuration.d.ts.map +1 -1
  22. package/types/core/Encore.d.ts +8 -33
  23. package/types/core/Encore.d.ts.map +1 -1
  24. package/types/core/OfferManager.d.ts +50 -9
  25. package/types/core/OfferManager.d.ts.map +1 -1
  26. package/types/core/PlacementBuilder.d.ts +11 -12
  27. package/types/core/PlacementBuilder.d.ts.map +1 -1
  28. package/types/core/useCase.d.ts +62 -0
  29. package/types/core/useCase.d.ts.map +1 -0
  30. package/types/core/version.d.ts +1 -1
  31. package/types/core/version.d.ts.map +1 -1
  32. package/types/types.d.ts +92 -223
  33. package/types/types.d.ts.map +1 -1
  34. package/types/ui/OfferCarousel.d.ts +81 -0
  35. package/types/ui/OfferCarousel.d.ts.map +1 -1
  36. package/types/ui/RewardActions.d.ts +60 -0
  37. package/types/ui/RewardActions.d.ts.map +1 -0
  38. package/types/ui/RewardCard.d.ts +49 -0
  39. package/types/ui/RewardCard.d.ts.map +1 -0
  40. package/types/ui/RewardConfetti.d.ts +46 -0
  41. package/types/ui/RewardConfetti.d.ts.map +1 -0
  42. package/types/ui/RewardLayout.d.ts +55 -0
  43. package/types/ui/RewardLayout.d.ts.map +1 -0
  44. package/types/ui/ThankYouLayout.d.ts +11 -0
  45. package/types/ui/ThankYouLayout.d.ts.map +1 -1
  46. package/types/ui/brandTint.d.ts +61 -0
  47. package/types/ui/brandTint.d.ts.map +1 -0
  48. package/types/ui/styles.d.ts +86 -0
  49. package/types/ui/styles.d.ts.map +1 -1
  50. package/types/utils/text.d.ts +24 -0
  51. package/types/utils/text.d.ts.map +1 -0
  52. package/examples/react/.env +0 -1
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { APIClient } from '../api/APIClient';
6
6
  import type { OfferModel } from '../api/models';
7
- import type { UserAttributes } from '../types';
7
+ import type { UserAttributes, UseCase } from '../types';
8
8
  import type { AnalyticsClient } from '../analytics/AnalyticsClient';
9
9
  export declare class OfferManager {
10
10
  #private;
@@ -12,17 +12,21 @@ export declare class OfferManager {
12
12
  /**
13
13
  * Fetch offers from API with optional caching
14
14
  */
15
- fetchOffers(userAttributes: UserAttributes, useCache?: boolean): Promise<{
15
+ fetchOffers(userAttributes: UserAttributes, useCache?: boolean, placementId?: string): Promise<{
16
16
  offers: OfferModel[];
17
17
  }>;
18
18
  /**
19
- * Begin a new presentation session
19
+ * Begin a new presentation session. `variantId` is the SDUI variant this
20
+ * presentation renders — stamped onto every event the session emits — and
21
+ * `useCase` is retained so the page-lifecycle flush can stamp it too.
20
22
  */
21
- beginPresentation(): string;
23
+ beginPresentation(variantId?: string, useCase?: UseCase): string;
24
+ /** The live presentation's id, or null between presentations. */
25
+ get presentationId(): string | null;
22
26
  /**
23
27
  * Track that an offer was presented (replaces impression logging)
24
28
  */
25
- trackOfferPresented(offer: OfferModel, impressionId: string, offerIndex: number, totalOffers: number): void;
29
+ trackOfferPresented(offer: OfferModel, impressionId: string, offerIndex: number, totalOffers: number, useCase?: UseCase): void;
26
30
  /**
27
31
  * Track that a user navigated away from an offer (pause time tracking)
28
32
  */
@@ -30,19 +34,56 @@ export declare class OfferManager {
30
34
  /**
31
35
  * Track offer claimed
32
36
  */
33
- trackOfferClaimed(offer: OfferModel, impressionId: string, transactionId: string, offerIndex: number, totalOffers: number): void;
37
+ trackOfferClaimed(offer: OfferModel, impressionId: string, transactionId: string, offerIndex: number, totalOffers: number, useCase?: UseCase): void;
34
38
  /**
35
39
  * Track offer declined
36
40
  */
37
- trackOfferDeclined(offer: OfferModel, impressionId: string, offerIndex: number, totalOffers: number, declineReason?: string): void;
41
+ trackOfferDeclined(offer: OfferModel, impressionId: string, offerIndex: number, totalOffers: number, declineReason?: string, useCase?: UseCase): void;
38
42
  /**
39
43
  * End the presentation session and send time tracking + dismissed events
40
44
  */
41
- endPresentation(declineReason?: string): void;
45
+ endPresentation(declineReason?: string, useCase?: UseCase): void;
46
+ /**
47
+ * Flush the live presentation's dwell + dismissal because the PAGE is going
48
+ * away, not because the user dismissed the sheet.
49
+ *
50
+ * This is the fix for `sdk_offer_time_spent` firing 7 times against 512
51
+ * impressions. Those rows were only ever emitted from a modal dismissal
52
+ * handler — close button, backdrop, decline, claim. A user who closes the tab,
53
+ * navigates away, or backgrounds the browser with the sheet open takes the
54
+ * whole presentation's dwell with them, and on the web that is the COMMON exit,
55
+ * not the edge case. The native SDKs have never had this hole because they get
56
+ * the same signal from app lifecycle (`app_backgrounded` / `app_terminated`,
57
+ * whose wire values are reused here verbatim).
58
+ *
59
+ * Delivery is `keepalive` — a plain fetch started during unload is cancelled
60
+ * with the document, so without it the events would be built and then dropped
61
+ * on the floor, which looks identical to never emitting them.
62
+ *
63
+ * The presentation is deliberately NOT torn down: the sheet may still be up
64
+ * (a `visibilitychange` is often just a tab switch). Impressions and claims
65
+ * after a return still carry the same `presentation_id`, and the emit path
66
+ * banks dwell rather than double-counting it.
67
+ *
68
+ * ONLY A TERMINAL SIGNAL EMITS THE DISMISSAL ROW. There is exactly one
69
+ * `sdk_offer_sheet_dismissed` per presentation, so whichever pass emits it
70
+ * decides how the presentation is recorded forever — and a backgrounding is
71
+ * not an ending (iOS labels `app_backgrounded` "Not an ending" for the same
72
+ * reason). Letting it claim the row would mislabel real outcomes wholesale:
73
+ * in IMMEDIATE mode the claim opens the advertiser tab synchronously inside
74
+ * the click gesture, which hides this document and fires
75
+ * `visibilitychange` while the transaction is still in flight — so EVERY
76
+ * successful claim would have been recorded as a backgrounded abandonment
77
+ * with truncated dwell. Dwell still flushes on both signals; that is the data
78
+ * the tab-close was losing, and it is additive rather than labelling.
79
+ */
80
+ flushForPageLifecycle(terminal: boolean, useCase?: UseCase): void;
81
+ /** Detach the page-lifecycle listeners (SDK reset / teardown). */
82
+ destroy(): void;
42
83
  /**
43
84
  * Start a transaction for an offer
44
85
  */
45
- startTransaction(campaignId: string): Promise<string>;
86
+ startTransaction(campaignId: string, useCase?: UseCase): Promise<string>;
46
87
  /**
47
88
  * Clear the offer cache
48
89
  */
@@ -1 +1 @@
1
- {"version":3,"file":"OfferManager.d.ts","sourceRoot":"","sources":["../../src/core/OfferManager.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAKpE,qBAAa,YAAY;;gBAWX,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,eAAe;IAMnF;;OAEG;IACG,WAAW,CACf,cAAc,EAAE,cAAc,EAC9B,QAAQ,UAAO,GACd,OAAO,CAAC;QAAE,MAAM,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAmCpC;;OAEG;IACH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G;IACG,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IAsB9E;;OAEG;IACH,UAAU,IAAI,IAAI;IAMlB;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;CAKhC"}
@@ -2,12 +2,16 @@
2
2
  * Placement Builder
3
3
  * Fluent API for configuring and presenting offers
4
4
  */
5
- import type { PlacementBuilder as IPlacementBuilder, PlacementOptions, ShowResult, RedeemResult, NotGrantedReason, ShowOptions } from '../types';
6
- export type PresentationExecutor = (options?: PlacementOptions, showOptions?: ShowOptions) => Promise<ShowResult>;
7
- export type RedeemExecutor = (placementId: string) => Promise<RedeemResult>;
5
+ import type { PlacementBuilder as IPlacementBuilder, PlacementOptions, ShowResult, NotGrantedReason, UseCase } from '../types';
6
+ export type PresentationExecutor = (options?: PlacementOptions) => Promise<ShowResult>;
8
7
  export declare class PlacementBuilder implements IPlacementBuilder {
9
8
  #private;
10
- constructor(id: string, executor: PresentationExecutor, options?: PlacementOptions, redeemExecutor?: RedeemExecutor);
9
+ constructor(id: string, executor: PresentationExecutor, options?: PlacementOptions);
10
+ /**
11
+ * Set this placement's use case (default `'reduceChurn'`) — the same `.useCase(...)` step
12
+ * the native SDKs expose, so a cross-platform integration reads the same here.
13
+ */
14
+ useCase(useCase: UseCase): PlacementBuilder;
11
15
  /**
12
16
  * Set callback for when user declines or offer not granted
13
17
  */
@@ -19,14 +23,9 @@ export declare class PlacementBuilder implements IPlacementBuilder {
19
23
  /**
20
24
  * Show the offer and execute the presentation flow.
21
25
  *
22
- * @param options Per-call show options (e.g. the `receipt` for the 'thankYou' layout).
23
- */
24
- show(options?: ShowOptions): Promise<ShowResult>;
25
- /**
26
- * Redeem the claim made at THIS placement — phase 2 of the two-phase flow.
27
- * Resolves the claim recorded for this placement id, renders the redemption
28
- * screen, and fires the advertiser redirect on the user's CTA. See Encore.redeem().
26
+ * Takes no arguments: everything a placement can be configured with lives in
27
+ * PlacementOptions, supplied to `placement()` or through the builder steps.
29
28
  */
30
- redeem(): Promise<RedeemResult>;
29
+ show(): Promise<ShowResult>;
31
30
  }
32
31
  //# sourceMappingURL=PlacementBuilder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlacementBuilder.d.ts","sourceRoot":"","sources":["../../src/core/PlacementBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACZ,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,oBAAoB,GAAG,CACjC,OAAO,CAAC,EAAE,gBAAgB,EAC1B,WAAW,CAAC,EAAE,WAAW,KACtB,OAAO,CAAC,UAAU,CAAC,CAAC;AACzB,MAAM,MAAM,cAAc,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE5E,qBAAa,gBAAiB,YAAW,iBAAiB;;gBAStD,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,gBAAgB,EAC1B,cAAc,CAAC,EAAE,cAAc;IAQjC;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,gBAAgB;IAK5E;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,gBAAgB;IAK9E;;;;OAIG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAoDtD;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,YAAY,CAAC;CAgBtC"}
1
+ {"version":3,"file":"PlacementBuilder.d.ts","sourceRoot":"","sources":["../../src/core/PlacementBuilder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EAChB,OAAO,EACR,MAAM,UAAU,CAAC;AAIlB,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;AAEvF,qBAAa,gBAAiB,YAAW,iBAAiB;;gBAO5C,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAMlF;;;OAGG;IACH,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,gBAAgB;IAK3C;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,gBAAgB;IAK5E;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,GAAG,gBAAgB;IAK9E;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA6ClC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * `useCase` — the PUBLIC↔WIRE seam, plus value validation.
3
+ *
4
+ * 🔴 THE PUBLIC SYMBOL AND THE WIRE VALUE ARE DIFFERENT STRINGS, DELIBERATELY.
5
+ *
6
+ * The public symbols (`reduceChurn`, `rewardUsers`) match iOS's `.reduceChurn` /
7
+ * `.rewardUsers` and Android's `REDUCE_CHURN` / `REWARD_USERS`, so a publisher
8
+ * shipping on three platforms reads one vocabulary. The wire values
9
+ * (`churn-intervention`, `post-action-reward`) are the backend's Postgres enum,
10
+ * frozen since `V107__Use_Case_Value_Driven_Identifiers.sql` and unrelated to the
11
+ * case names — exactly as Android's own enum states it: *"Wire values are frozen
12
+ * and unrelated to the case names."*
13
+ *
14
+ * Everything that leaves this SDK carries the WIRE value:
15
+ * - `GET /config?useCase=post-action-reward`
16
+ * - `POST /transactions { useCase: 'post-action-reward' }`
17
+ * - the `use_case` analytics event property
18
+ * - the keys of the `/config` response's `useCases` prefetch block
19
+ *
20
+ * Everything a publisher touches carries the PUBLIC symbol. This module is the ONLY
21
+ * place the two meet: `toWireUseCase` on the way out, `fromWireUseCase` on the way
22
+ * in. Changing a wire value here misattributes reward revenue permanently and
23
+ * silently — there is no error anywhere, the rows just land under the wrong use
24
+ * case. `useCase.test.ts` pins the mapping in both directions for that reason.
25
+ */
26
+ import { type EncoreError, type UseCase } from '../types';
27
+ /**
28
+ * The values the backend speaks. INTERNAL — deliberately not re-exported from
29
+ * `index.ts`: a publisher never types one of these, and exporting it would invite
30
+ * integrations to hard-code the wire strings this seam exists to hide.
31
+ */
32
+ export type WireUseCase = 'churn-intervention' | 'post-action-reward';
33
+ /** Public symbol → the value that goes on the wire. Total by construction. */
34
+ export declare function toWireUseCase(useCase: UseCase): WireUseCase;
35
+ /**
36
+ * Wire value → public symbol, or `undefined` for anything this SDK version does not
37
+ * recognise. Tolerant by design: the backend may serve a use case added after this
38
+ * SDK shipped, and an unknown key must be DROPPED (the caller no-ops) rather than
39
+ * coerced into one of the two we know — serving a paywall where a reward was meant
40
+ * is the failure this whole dimension exists to prevent.
41
+ */
42
+ export declare function fromWireUseCase(wire: string | null | undefined): UseCase | undefined;
43
+ /**
44
+ * `null` when `value` is a recognised use case (or omitted, which defaults to
45
+ * `'reduceChurn'` elsewhere), otherwise the error describing the rejection.
46
+ *
47
+ * An ALLOW-list, not a deny-list — the same design as the closed
48
+ * `feat/reject-streaks-use-case` PR (#21). An unrecognised value (a typo, a use case
49
+ * added to the platform before this SDK knows about it, or one that gets RENAMED)
50
+ * must fail closed. A `!== 'streaks'` deny-list would have kept compiling and
51
+ * silently served the paywall the day that value was renamed.
52
+ *
53
+ * Note the allow-list is on the PUBLIC symbols, so a caller who hard-coded a wire
54
+ * value (`'post-action-reward'`) is rejected here rather than quietly presenting the
55
+ * wrong surface — which is the correct answer for a 3.0.0 rename.
56
+ *
57
+ * Distinct from ENABLEMENT (does this app have the surface turned on), which is
58
+ * resolved from the config response's `useCases` map at show()-time and fails closed
59
+ * as `no_template`, not `INVALID_REQUEST`.
60
+ */
61
+ export declare function checkUseCase(value: unknown): EncoreError | null;
62
+ //# sourceMappingURL=useCase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCase.d.ts","sourceRoot":"","sources":["../../src/core/useCase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAa,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,UAAU,CAAC;AAErE;;;;GAIG;AACH,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAuBtE,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,WAAW,CAE3D;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAGpF;AAOD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,GAAG,IAAI,CAS/D"}
@@ -1,3 +1,3 @@
1
1
  /** SDK version — single source of truth (also kept in sync with package.json via scripts/update-version.sh) */
2
- export declare const SDK_VERSION = "1.1.21";
2
+ export declare const SDK_VERSION = "2.0.1";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,eAAO,MAAM,WAAW,WAAW,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/core/version.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,eAAO,MAAM,WAAW,UAAU,CAAC"}
package/types/types.d.ts CHANGED
@@ -95,135 +95,75 @@ export interface AppearanceConfig {
95
95
  accentColor?: string;
96
96
  }
97
97
  /**
98
- * `'thankYou'`-only priming copy shown ABOVE the offers — the lead-in pair between
99
- * the payment status and the carousel, context for why offers are being shown (never
100
- * any one offer's own copy). Ignored by the `'list'` layout, whose top heading is
101
- * `header` instead: one name means one thing in every layout.
98
+ * WHY a placement presents — Encore's platform-wide use-case dimension, and the ONLY
99
+ * thing that selects a composition. It is distinct from the publisher's free-text
100
+ * placement id.
101
+ *
102
+ * - `'reduceChurn'` (default): the offer carousel — a save attempt at a moment the
103
+ * user is leaving.
104
+ * - `'rewardUsers'`: celebrates a user moment (a purchase, a milestone, a streak) —
105
+ * claim-only, no in-app-purchase ask anywhere in it. Renders the reward
106
+ * composition: its own headline chrome around a paged carousel.
107
+ *
108
+ * These symbols match the native SDKs verbatim — iOS `.reduceChurn`/`.rewardUsers`,
109
+ * Android `REDUCE_CHURN`/`REWARD_USERS` — so a cross-platform integration reads one
110
+ * vocabulary.
111
+ *
112
+ * 🔴 THE WIRE VALUES ARE DIFFERENT STRINGS AND ARE FROZEN. `/config`, `/transactions`
113
+ * and the `use_case` analytics property still carry `churn-intervention` /
114
+ * `post-action-reward`; `core/useCase.ts` is the only place the two meet. You never
115
+ * type a wire value — passing one is rejected as an unrecognised use case.
116
+ *
117
+ * Requesting a surface the app is not enabled for (or that has no resolved copy) is
118
+ * not an error: it resolves as a no-op (`ShowResult: 'unavailable'`,
119
+ * `sdk_offer_presentation_failed` reason `'no_template'`) and NEVER falls back to
120
+ * another use case's cached copy — see `core/useCase.ts` for the value-level
121
+ * allow-list this is paired with.
102
122
  */
103
- export interface OfferContextConfig {
104
- title?: string;
105
- /**
106
- * Context subtitle. When the active offer's campaign carries a `perk` line (e.g.
107
- * "Enjoy 30 days of Apple Music free") the perk takes this slot and follows the
108
- * carousel as it pages; this value is the per-placement fallback.
109
- */
110
- subtitle?: string;
111
- }
112
- /**
113
- * Layout template for a placement presentation.
114
- * - `'list'` (default): today's offer sheet — header copy + offer carousel.
115
- * - `'thankYou'`: post-purchase success composition — status check + payment-status
116
- * header + intro copy + carousel + optional trust footer.
117
- */
118
- export type PlacementLayout = 'list' | 'thankYou';
123
+ export type UseCase = 'reduceChurn' | 'rewardUsers';
119
124
  /**
120
- * The sheet's top heading block — in EVERY layout. In `'list'` it is the modal
121
- * title/subtitle above the offers (local override of the remote copy); in
122
- * `'thankYou'` it is the payment-status block (check + title + subtitle). The host
123
- * supplies the copy — the SDK never invents payment facts.
125
+ * Everything a placement can be configured with. One flat shape: the composition is
126
+ * DERIVED from {@link useCase}, never selected separately.
124
127
  */
125
- export interface PlacementHeaderConfig {
128
+ export interface PlacementOptions {
126
129
  /**
127
- * Status icon (`'thankYou'` only). `'success'` (default) renders a green-circle
128
- * check; `'none'` hides it. Ignored by `'list'`.
130
+ * Why this placement presents, which is also what it renders. Defaults to
131
+ * `'reduceChurn'` — the offer carousel. See {@link UseCase}.
129
132
  */
130
- icon?: 'success' | 'none';
133
+ useCase?: UseCase;
131
134
  /**
132
- * Heading title. In `'list'` the sheet title (falls back to remote copy when
133
- * omitted); in `'thankYou'` the status title, e.g. "Payment Successful"
134
- * (omitted → not rendered).
135
+ * The sheet's headline for THIS presentation — the same slot the native SDKs'
136
+ * `.headline(...)` fills, and the primary way to supply reward copy.
137
+ *
138
+ * A per-call override, and it applies to both use cases: it beats the
139
+ * backend-resolved copy, which in turn beats the SDK's built-in fallback. Blank or
140
+ * whitespace-only falls THROUGH to the resolved copy rather than blanking the
141
+ * sheet — omit the field instead of passing `''`.
135
142
  */
136
- title?: string;
143
+ headline?: string;
144
+ /** Counterpart to {@link headline}: same precedence, same blank-falls-through rule. */
145
+ subheadline?: string;
137
146
  /**
138
- * Heading subtitle (a plain constant string). In `'list'` the sheet subtitle; in
139
- * `'thankYou'` the muted status line, where a `receipt` passed to `show()` takes
140
- * precedence over this slot.
147
+ * Status icon above the headline. Defaults to `'none'` — nothing renders unless
148
+ * you explicitly ask for `'success'`, which draws a green-circle check.
149
+ *
150
+ * Only the `'rewardUsers'` composition has a status block to put it in;
151
+ * `'reduceChurn'` renders the carousel bare and ignores this.
152
+ *
153
+ * The default is `'none'` deliberately, and it MATCHES THE NATIVE SDKS: the
154
+ * reward variant (`streaksCarousel.json`, the same screen iOS and Android render)
155
+ * contains no checkmark at all — it opens with layered gradients and a confetti
156
+ * burst. A green success check is a payment-status icon; a reward sheet has not
157
+ * finished anything yet, it is still asking the user to choose a gift. Opting in
158
+ * is supported for the rare integration that wants one.
141
159
  */
142
- subtitle?: string;
143
- }
144
- /** Trust footer for the `'thankYou'` layout. Omitted → not rendered. */
145
- export interface PlacementFooterConfig {
146
- /** Small muted centered line, e.g. "🔒 Secured by Acme". */
147
- text?: string;
148
- }
149
- /**
150
- * Host-product display nouns for the deferred flow's SDK-composed copy (the S1
151
- * header default, the primer screen, the redemption screen). Every field is optional
152
- * in the TYPE because each resolves through a chain — local value, else remote
153
- * /config (app name, native entitlement, app icon) — and requiredness is enforced at
154
- * RUNTIME by the display contract (see core/DisplayResolver.ts). Display only;
155
- * nothing here gates behavior.
156
- */
157
- export interface HostDisplay {
158
- /** Host product name, e.g. "PlanetVPN". Falls back to the remote app name. */
159
- appDisplayName?: string;
160
- /**
161
- * Display-only trial length, e.g. "1 month" — never parsed. Falls back to the
162
- * remote native-entitlement value + unit.
163
- */
164
- trialPeriod?: string;
165
- /** Host logo URL (https). Falls back to the remote app icon when available. */
166
- logoUrl?: string;
167
- }
168
- /**
169
- * Options shared by every layout. Layout-specific options extend this — see
170
- * ListPlacementOptions / ThankYouPlacementOptions; PlacementOptions is their union,
171
- * discriminated on `layout`.
172
- */
173
- export interface BasePlacementOptions {
160
+ statusIcon?: 'success' | 'none';
174
161
  appearance?: AppearanceConfig;
175
- /** Top heading block: modal title in `'list'`, payment status in `'thankYou'`. */
176
- header?: PlacementHeaderConfig;
177
- /** Host display nouns — local override of the remote-config defaults. */
178
- display?: HostDisplay;
179
- /**
180
- * Per-placement override of the configure() redemptionMode. Layout and mode are
181
- * ORTHOGONAL axes: layout composes the UI; redemptionMode decides whether the
182
- * claim redirects now ('immediate') or is decoupled from redemption ('deferred'
183
- * — the host calls redeem() after its own conversion). Unusual combinations
184
- * (e.g. 'thankYou' + 'deferred') are allowed and warned, not forbidden.
185
- */
186
- redemptionMode?: 'deferred' | 'immediate';
187
- }
188
- /** The default offer sheet. */
189
- export interface ListPlacementOptions extends BasePlacementOptions {
190
- layout?: 'list';
191
- }
192
- /** The post-purchase success composition. */
193
- export interface ThankYouPlacementOptions extends BasePlacementOptions {
194
- layout: 'thankYou';
195
- /** Priming pair above the offers. */
196
- offerContext?: OfferContextConfig;
197
- /** Trust footer. Omitted → not rendered. */
198
- footer?: PlacementFooterConfig;
199
- }
200
- export type PlacementOptions = ListPlacementOptions | ThankYouPlacementOptions;
201
- /**
202
- * Per-transaction receipt details for the `'thankYou'` layout. Rendered by the SDK as
203
- * "You paid {amount} for {purpose}" (or "You paid {amount}" without a purpose) in the
204
- * payment-status subtitle slot. Values are rendered verbatim as text — pre-format the
205
- * currency on your side.
206
- */
207
- export interface Receipt {
208
- /** Pre-formatted amount, e.g. "NGN 100". */
209
- amount: string;
210
- /** What was paid for, e.g. "Demo". */
211
- purpose?: string;
212
162
  }
213
163
  /**
214
- * Per-call options for show().
164
+ * Presentation callbacks for the bare `Encore.show()` form.
215
165
  */
216
- export interface ShowOptions {
217
- /**
218
- * Per-transaction receipt for the `'thankYou'` layout. When provided it owns the
219
- * payment-status subtitle (overriding `header.subtitle`). Ignored by `'list'`.
220
- */
221
- receipt?: Receipt;
222
- }
223
- /**
224
- * Presentation callbacks and show-time options
225
- */
226
- export interface PresentationOptions extends ShowOptions {
166
+ export interface PresentationOptions {
227
167
  /**
228
168
  * Fires when the user completes the offer flow (provisional grant). The argument is the
229
169
  * deprecated, display-derived entitlement and may be `undefined`.
@@ -238,13 +178,21 @@ export interface PresentationOptions extends ShowOptions {
238
178
  * Builder pattern for placement API
239
179
  */
240
180
  export interface PlacementBuilder {
181
+ /**
182
+ * Set this placement's use case (default `'reduceChurn'`) — the same
183
+ * `.useCase(...)` step the native SDKs expose. See {@link UseCase}.
184
+ */
185
+ useCase(useCase: UseCase): PlacementBuilder;
241
186
  /** Fires when the sheet closes without a claim — carries the dismissal reason. */
242
187
  onNotGranted(callback: (reason: NotGrantedReason) => void): PlacementBuilder;
243
188
  onLoadingStateChange(callback: (isLoading: boolean) => void): PlacementBuilder;
244
- /** Same bare ShowResult contract as Encore.show(). Never rejects. */
245
- show(options?: ShowOptions): Promise<ShowResult>;
246
- /** Redeem the transaction made at this placement — phase 2 of the two-phase flow. */
247
- redeem(): Promise<RedeemResult>;
189
+ /**
190
+ * Present the sheet. Takes no arguments — everything a placement can be
191
+ * configured with lives in {@link PlacementOptions}, passed to `placement()` or
192
+ * set through the builder steps above. Same bare ShowResult contract as
193
+ * `Encore.show()`. Never rejects.
194
+ */
195
+ show(): Promise<ShowResult>;
248
196
  }
249
197
  /**
250
198
  * Error codes used throughout the SDK
@@ -306,74 +254,37 @@ export interface EncoreConfig {
306
254
  apiKey: string;
307
255
  environment?: 'production' | 'development' | 'staging' | 'localhost';
308
256
  logLevel?: 'none' | 'debug';
309
- /**
310
- * Redemption flow:
311
- * - 'deferred' (default): show() resolves when the user CLAIMS an offer (a transaction
312
- * record is created, NO redirect). The host runs its own conversion, then calls
313
- * redeem() to render the redemption screen + send the user to the advertiser.
314
- * - 'immediate': the legacy one-step flow — claiming an offer redirects to the
315
- * advertiser and shows the success screen inline (no separate redeem() call).
316
- * This is a control-flow contract (it changes what host code must call), so it is
317
- * a LOCAL config value, not remote.
318
- */
319
- redemptionMode?: 'deferred' | 'immediate';
320
- }
321
- /**
322
- * Offer descriptor carried on a transaction — enough to render the redemption screen AND
323
- * to rebuild the advertiser redirect at redeem() time (so the deferred flow never
324
- * needs the live offer again). `advertiserUrl` may contain a TRANSACTION_ID
325
- * placeholder, substituted with the transaction id when the redemption fires.
326
- */
327
- export interface OfferRef {
328
- id: string;
329
- campaignId: string;
330
- advertiserUrl: string;
331
- trackingParameters?: Record<string, string>;
332
- advertiserName?: string;
333
- /** Display-only reward copy (e.g. "30 days of Apple Music"). NOT an entitlement. */
334
- reward?: string;
335
- imageUrl?: string;
336
- logoUrl?: string;
337
- }
338
- /**
339
- * A claimed offer awaiting redemption. Claiming starts a transaction, and the
340
- * returned `transactionId` is this transaction's durable handle (the same id used by
341
- * `didGrant`, `waitForVerification`, and the backend).
342
- */
343
- export interface Transaction {
344
- id: string;
345
- /** The persistent account identity this transaction is bound to (app_account_id). */
346
- appAccountId: string;
347
- /** The placement the offer was claimed at, if any (keys the local placement->transaction map). */
348
- placementId?: string;
349
- offer: OfferRef;
350
- /**
351
- * The layout of the placement the claim happened on — claim provenance (a
352
- * transactional fact, like placementId). Drives which redemption narrative
353
- * renders: a 'list' claim earns the activation story (host trial + ledger); a
354
- * 'thankYou' claim renders the minimal reward story. Absent on legacy
355
- * transactions → reward (the safe minimal narrative).
356
- */
357
- claimLayout?: PlacementLayout;
358
- status: 'claimed' | 'redeemed';
359
- /** ISO-8601 timestamps. */
360
- createdAt: string;
361
- expiresAt: string;
362
- redeemedAt?: string;
363
257
  }
364
258
  /** Result of `show()` / `present()`. */
365
259
  export type ShowResult =
366
260
  /**
367
- * The user claimed an offer. A transaction was recorded SDK-side, and in
368
- * 'immediate' mode the advertiser was also opened in a new tab; the SDK
369
- * renders nothing after a claim — the host owns that moment. Deliberately
370
- * NOT a conversion claim: advertiser conversion is asynchronous and
371
- * server-authoritative; check it server-side by user (never from the client).
372
- * In 'deferred' mode, call redeem() after your own conversion work — the SDK
373
- * resolves the pending transaction internally; no handle needed.
261
+ * The user claimed an offer: the advertiser was opened in a new tab. The SDK
262
+ * renders nothing after a claim — the host owns that moment.
263
+ *
264
+ * 🔴 A CLAIM IS NOT A CONVERSION. This reports a presentation fact — the user
265
+ * tapped Claim and was handed off. Advertiser conversion happens later, is
266
+ * asynchronous, and is server-authoritative: check it on your backend, never
267
+ * from the client.
268
+ *
269
+ * The payload mirrors iOS's and Android's `ClaimedOffer` field-for-field so the
270
+ * React Native and Flutter bridges line up:
271
+ *
272
+ * - `transactionId` is the claim's durable handle — the id the backend keys on,
273
+ * and the argument `didGrant()` and `waitForVerification()` take. It is how a
274
+ * completion that lands days later is traced back to this user and app, so
275
+ * keep it. It is OPTIONAL because the transaction write can fail while the
276
+ * claim itself genuinely happened; the SDK logs a warning when that occurs
277
+ * rather than fabricating a placeholder.
278
+ * - `offerId` / `campaignId` identify what was claimed. (On iOS these are the
279
+ * same value; on web they are distinct, and both are reported.)
280
+ * - `advertiserName` is the merchant's display name.
374
281
  */
375
282
  {
376
283
  status: 'claimed';
284
+ offerId: string;
285
+ campaignId: string;
286
+ advertiserName: string;
287
+ transactionId?: string;
377
288
  }
378
289
  /** The user dismissed the carousel without claiming. */
379
290
  | {
@@ -384,48 +295,6 @@ export type ShowResult =
384
295
  | {
385
296
  status: 'unavailable';
386
297
  };
387
- /** Options for `redeem()`. */
388
- export interface RedeemOptions {
389
- /**
390
- * Resolve the transaction made at this placement (the local placement->transaction map). When
391
- * passed via Encore.placement(id).redeem() this is the placement id. If no transaction
392
- * exists for the placement, resolves `none` — it never crosses to another placement.
393
- */
394
- placement?: string;
395
- /**
396
- * Host product row for the redemption screen's deal ledger. Override-only: name
397
- * and logo default from the same display resolution show() uses (live remote
398
- * config), so most integrations never pass this. The trial-end detail line is
399
- * always DERIVED (remote durationDays + the redemption moment) — not settable.
400
- */
401
- host?: {
402
- name?: string;
403
- status?: string;
404
- logoUrl?: string;
405
- };
406
- }
407
- /** Result of `redeem()`. */
408
- export type RedeemResult =
409
- /** The advertiser redirect was performed for the pending transaction. */
410
- {
411
- status: 'redeemed';
412
- }
413
- /**
414
- * The sheet closed without redeeming. `reason` mirrors show(): user-driven
415
- * closes carry no reason or a user reason; internal failures carry
416
- * `{ type: 'error', error }` — redeem() never rejects. On an error the pending
417
- * transaction is untouched, so calling redeem() again later is safe.
418
- */
419
- | {
420
- status: 'dismissed';
421
- reason?: NotGrantedReason;
422
- } | {
423
- status: 'expired';
424
- }
425
- /** STRICTLY "no pending transaction to redeem" — never an error disguise. */
426
- | {
427
- status: 'none';
428
- };
429
298
  /**
430
299
  * A subscription/conversion event forwarded from the host (Tier-1 client signal).
431
300
  * NON-AUTHORITATIVE — posted via the pk-authed analytics channel, never the HMAC
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAA;CAAE,GAC/D;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;CAAE,GAClE;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,aAAa,GAAG,KAAK,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,aAAa,GAAG,UAAU,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;CAClD;AAMD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACn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