@encorekit/web-sdk 2.0.3 → 2.0.4

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 (46) hide show
  1. package/dist/cjs/index.cjs +1 -1
  2. package/dist/cjs/index.cjs.map +1 -1
  3. package/dist/esm/index.js +1 -1
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/umd/encore.min.js +1 -1
  6. package/dist/umd/encore.min.js.map +1 -1
  7. package/package.json +2 -1
  8. package/types/analytics/DiagnosticsOutbox.d.ts +22 -0
  9. package/types/analytics/DiagnosticsOutbox.d.ts.map +1 -0
  10. package/types/analytics/ReliableOutbox.d.ts +40 -0
  11. package/types/analytics/ReliableOutbox.d.ts.map +1 -0
  12. package/types/analytics/events.d.ts +100 -0
  13. package/types/analytics/events.d.ts.map +1 -1
  14. package/types/analytics/placementResolved.d.ts +150 -0
  15. package/types/analytics/placementResolved.d.ts.map +1 -0
  16. package/types/api/APIClient.d.ts +7 -1
  17. package/types/api/APIClient.d.ts.map +1 -1
  18. package/types/core/Configuration.d.ts +5 -0
  19. package/types/core/Configuration.d.ts.map +1 -1
  20. package/types/core/Encore.d.ts +36 -0
  21. package/types/core/Encore.d.ts.map +1 -1
  22. package/types/core/OfferManager.d.ts +29 -3
  23. package/types/core/OfferManager.d.ts.map +1 -1
  24. package/types/core/PlacementBuilder.d.ts +12 -0
  25. package/types/core/PlacementBuilder.d.ts.map +1 -1
  26. package/types/core/StrictUnlock.d.ts +20 -0
  27. package/types/core/StrictUnlock.d.ts.map +1 -0
  28. package/types/core/StrictUnlockReconciler.d.ts +94 -0
  29. package/types/core/StrictUnlockReconciler.d.ts.map +1 -0
  30. package/types/core/useCase.d.ts +21 -0
  31. package/types/core/useCase.d.ts.map +1 -1
  32. package/types/core/version.d.ts +1 -1
  33. package/types/experiments/ExposureOutbox.d.ts +4 -28
  34. package/types/experiments/ExposureOutbox.d.ts.map +1 -1
  35. package/types/types.d.ts +42 -2
  36. package/types/types.d.ts.map +1 -1
  37. package/types/ui/OfferCard.d.ts +3 -1
  38. package/types/ui/OfferCard.d.ts.map +1 -1
  39. package/types/ui/OfferCarousel.d.ts +5 -0
  40. package/types/ui/OfferCarousel.d.ts.map +1 -1
  41. package/types/ui/OfferModal.d.ts.map +1 -1
  42. package/types/ui/RewardActions.d.ts +9 -0
  43. package/types/ui/RewardActions.d.ts.map +1 -1
  44. package/types/ui/appearance.d.ts +14 -0
  45. package/types/ui/appearance.d.ts.map +1 -1
  46. package/types/ui/styles.d.ts.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@encorekit/web-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "type": "module",
5
5
  "description": "Encore SDK for web applications - display targeted offers and manage user entitlements",
6
6
  "main": "./dist/cjs/index.cjs",
@@ -40,6 +40,7 @@
40
40
  "build:watch": "rollup -c -w",
41
41
  "test": "vitest run",
42
42
  "test:watch": "vitest",
43
+ "verify:demo": "node scripts/verify-demo.mjs",
43
44
  "typecheck": "tsc --noEmit -p tsconfig.build.json",
44
45
  "lint": "eslint src --ext .ts,.tsx",
45
46
  "lint:fix": "eslint src --ext .ts,.tsx --fix",
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Reliable delivery for the `show()` choke-point diagnostics: `sdk_show_entered`,
3
+ * `sdk_show_aborted`, and the terminal `sdk_placement_resolved`.
4
+ *
5
+ * ONE outbox for all three, matching iOS, where every diagnostic goes through
6
+ * `Encore.shared.services.outbox` (`OfferSheetCoordinator.enqueueDiagnostic`).
7
+ * They share a delivery guarantee for the same reason: each one is the only
8
+ * evidence of an exit that produces no other event, so a row that only sometimes
9
+ * survives the tab closing is worse than none — the loss is invisible *and*
10
+ * biased toward the exits that close the page.
11
+ *
12
+ * Sharing one queue also means one set of page-lifecycle listeners for the whole
13
+ * diagnostic family rather than one per event type.
14
+ *
15
+ * See `ReliableOutbox` for the mechanism.
16
+ */
17
+ import { ReliableOutbox } from './ReliableOutbox';
18
+ import type { StorageManager } from '../core/StorageManager';
19
+ export declare class DiagnosticsOutbox extends ReliableOutbox {
20
+ constructor(apiKey: string, analyticsBaseURL: string, storage: StorageManager);
21
+ }
22
+ //# sourceMappingURL=DiagnosticsOutbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DiagnosticsOutbox.d.ts","sourceRoot":"","sources":["../../src/analytics/DiagnosticsOutbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAI7D,qBAAa,iBAAkB,SAAQ,cAAc;gBACvC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc;CAG9E"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Reliable delivery for analytics events that must survive tab-close — unlike
3
+ * the fire-and-forget AnalyticsClient, this path is storage-backed and retried.
4
+ *
5
+ * Delivery primitive: `fetch(url, { keepalive: true })` — NOT `navigator.sendBeacon`.
6
+ * The ingest endpoint authenticates on the `X-Analytics-Key` request header, and
7
+ * sendBeacon cannot set headers (a beacon would arrive unauthenticated). keepalive
8
+ * fetch survives document unload like a beacon AND carries the auth header.
9
+ *
10
+ * Reliability model:
11
+ * - enqueue: persist the envelope, then keepalive-POST; remove on 2xx.
12
+ * - flush: replay every persisted envelope (on SDK init + on pagehide /
13
+ * visibilitychange:hidden) so a send that died with the tab retries.
14
+ * - envelopes carry a STABLE event_id → retries are idempotent backend-side.
15
+ * - an in-memory in-flight set avoids duplicate concurrent sends.
16
+ * - all storage / window / document access is SSR- and failure-guarded (fail-open).
17
+ *
18
+ * Extracted from ExposureOutbox, which was the first consumer of this pattern:
19
+ * every consumer gets its own instance (and its own storage key), so multiple
20
+ * ReliableOutbox instances bind independent lifecycle listeners — harmless
21
+ * duplication, not worth a shared coordinator for a small number of consumers.
22
+ */
23
+ import type { AnalyticsEvent } from './models';
24
+ import type { StorageManager } from '../core/StorageManager';
25
+ export declare class ReliableOutbox {
26
+ #private;
27
+ constructor(apiKey: string, analyticsBaseURL: string, storage: StorageManager, storageKey: string);
28
+ /**
29
+ * Persist an event and attempt delivery. `eventId` must be stable for a given
30
+ * (user, epoch) so retries de-duplicate backend-side. Returns whether the
31
+ * envelope durably landed in the configured storage tier: a quota-driven
32
+ * fallback-to-memory write is invisible to a fresh read, so the caller can avoid
33
+ * marking the epoch logged (and re-enqueue on the next trigger) instead of
34
+ * silently dropping the event.
35
+ */
36
+ enqueue(event: AnalyticsEvent, eventId: string): boolean;
37
+ /** Replay every persisted envelope (init recovery + unload flush). */
38
+ flush(): void;
39
+ }
40
+ //# sourceMappingURL=ReliableOutbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReliableOutbox.d.ts","sourceRoot":"","sources":["../../src/analytics/ReliableOutbox.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAiB,MAAM,UAAU,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,qBAAa,cAAc;;gBAOb,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM;IAQjG;;;;;;;OAOG;IACH,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO;IAaxD,sEAAsE;IACtE,KAAK,IAAI,IAAI;CAoDd"}
@@ -215,6 +215,106 @@ export declare function offerWebviewLoadFailed(distinctId: string, ctx: OfferEve
215
215
  export declare function offerWebviewDismissed(distinctId: string, ctx: OfferEventContext, params: {
216
216
  timeSpentSeconds: number;
217
217
  }): AnalyticsEvent;
218
+ /**
219
+ * A strict-unlock claim confirmed by the advertiser's postback. Mirrors iOS
220
+ * `OfferVerifiedEvent`, including its two shapes: with the presentation context
221
+ * when the claim verified inside the session that made it, and with the
222
+ * transaction id ALONE when a later page load reconciled it.
223
+ *
224
+ * The context is optional for exactly that second case, and absent fields stay
225
+ * absent rather than being reconstructed — the same rule `OfferEventContext`
226
+ * states above. A reconciled claim genuinely has no impression or presentation in
227
+ * scope (the page that held them is gone), and `impression_id` is the warehouse's
228
+ * primary claim↔completion join key: a fabricated one joins against nothing while
229
+ * looking like coverage, where an absent one falls through to the documented
230
+ * `transaction_id` fallback and joins correctly.
231
+ *
232
+ * 🔴 `use_case` and `placement_id` are the exception, and they are NOT
233
+ * presentation-scoped. They describe the claim, which is the thing being verified, so
234
+ * they survive the page that made it — persisted on the pending record precisely so
235
+ * the reconciled shape can still carry them (`StrictUnlockReconciler.PendingClaim`,
236
+ * mirroring swift#123). Without them a strict-mode verification is the one conversion
237
+ * signal that falls outside every per-use-case and per-placement split, which is the
238
+ * comparison strict mode exists to be judged on. The bare shape is bare of
239
+ * PRESENTATION identity — `impression_id`, `presentation_id`, `variant_id` — not of
240
+ * every dimension.
241
+ *
242
+ * Only ever emitted in `unlockMode: 'strict'` — optimistic mode does no
243
+ * verification, so it has nothing to report.
244
+ */
245
+ export declare function offerVerified(distinctId: string, params: {
246
+ transactionId: string;
247
+ useCase?: UseCase;
248
+ placementId?: string;
249
+ }, ctx?: OfferEventContext): AnalyticsEvent;
250
+ /**
251
+ * Why a `show()` exited before `sdk_offer_presentation_triggered` fired.
252
+ *
253
+ * The cross-SDK vocabulary, matching iOS's `ShowAbortReason` — not extended with
254
+ * web-only members. Two of web's pre-trigger exits (an invalid `useCase` value, a
255
+ * use case with no resolved copy) have no member here and therefore emit no
256
+ * `sdk_show_aborted`; both are fully described by `sdk_placement_resolved`'s
257
+ * `not_presented_reason`. Adding values to a frozen cross-SDK vocabulary is a
258
+ * cross-SDK decision, not a web one.
259
+ *
260
+ * `unsupported_os` exists on iOS and can never occur here — a browser that runs
261
+ * this bundle can render the sheet.
262
+ */
263
+ export declare const ShowAbortReason: {
264
+ readonly NOT_CONFIGURED: "not_configured";
265
+ readonly ALREADY_PRESENTING: "already_presenting";
266
+ readonly EXPERIMENT_CONTROL: "experiment_control";
267
+ };
268
+ export type ShowAbortReasonValue = (typeof ShowAbortReason)[keyof typeof ShowAbortReason];
269
+ /**
270
+ * `show()` was called — emitted at the very top, before any gate.
271
+ *
272
+ * The only evidence the SDK was reached at all on an attempt that then exits
273
+ * somewhere with nothing else to say. `sdk_placement_resolved` covers every exit
274
+ * *after* configuration; this one is what makes "the host called `show()`"
275
+ * observable independently of what happened next.
276
+ *
277
+ * `layer` distinguishes the SDK that emitted it, since the React Native and
278
+ * Flutter bridges sit on top of this one and emit their own.
279
+ *
280
+ * No `variant_id`: at this point the SDK has not resolved which variant this
281
+ * attempt will render, and stamping the paywall's variant on what turns out to be
282
+ * a reward presentation is precisely the mis-attribution the per-use-case variant
283
+ * resolution exists to prevent.
284
+ *
285
+ * `use_case` IS known, however, because the caller asked for it, and it is stamped
286
+ * from the base property set rather than through the conditional `useCaseProperty`
287
+ * the offer-funnel events use. Required in the params type for the same reason: this
288
+ * dimension partitions a backend alarm (see `showAborted`), and a property that can
289
+ * be omitted eventually is.
290
+ */
291
+ export declare function showEntered(distinctId: string, params: {
292
+ presentationId: string;
293
+ useCase: UseCase;
294
+ placementId?: string;
295
+ }): AnalyticsEvent;
296
+ /**
297
+ * A `show()` that exited at a pre-trigger gate. The taxonomy iOS draws and this
298
+ * mirrors: `sdk_show_aborted` means the attempt never entered the presentation
299
+ * funnel, `sdk_offer_presentation_failed` means it entered and did not reach
300
+ * presented.
301
+ *
302
+ * 🔴 `use_case` is REQUIRED and stamped from the base property set, never through the
303
+ * conditional `useCaseProperty`. Backend #443 counts `control_suppressions` off this
304
+ * event PARTITIONED BY use case, as the input to the D-6 bypass alarm — so a row
305
+ * without the dimension is not merely a thinner row, it is a suppression that lands
306
+ * in a NULL bucket and goes uncounted by the alarm it was supposed to feed. A
307
+ * conditional spread would make that the behaviour of whichever abort reason happened
308
+ * to be missing a use case; required-and-unconditional makes it unreachable. iOS
309
+ * (swift#123) and Android (android#55) stamp it the same way, off a non-optional enum.
310
+ */
311
+ export declare function showAborted(distinctId: string, params: {
312
+ reason: ShowAbortReasonValue;
313
+ presentationId: string;
314
+ useCase: UseCase;
315
+ placementId?: string;
316
+ variantId?: string;
317
+ }): AnalyticsEvent;
218
318
  /**
219
319
  * The server-assigned variant landed and the sheet will render it.
220
320
  *
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/analytics/events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAQxC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AA+BX;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGrF;AAMD,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAClB,cAAc,CAMhB;AAED,wBAAgB,cAAc,CAC5B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACnC,cAAc,CAMhB;AAiFD,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,EACjB,WAAW,CAAC,EAAE,MAAM,GAC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AU,CAAC;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,GACA,cAAc,CAahB;AAMD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,iBAAiB,EAAE,MAAM,CAAA;CAAE,GACxE,cAAc,CAWhB;AAMD,wBAAgB,QAAQ,CACtB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,MAAM,EACxB,OAAO,CAAC,EAAE,MAAM,GACf,cAAc,CAMhB"}
@@ -0,0 +1,150 @@
1
+ /**
2
+ * `sdk_placement_resolved` — the terminal record for one `show()` attempt, in
3
+ * iOS/Android's frozen outcome vocabulary (`PresentationResult.swift`).
4
+ *
5
+ * Exactly one row per attempt, whatever happened: not configured, use case not
6
+ * enabled, control cohort, no offers, claimed, dismissed, or blown up. That is the
7
+ * whole point of it — every OTHER event in the funnel exists only on the path that
8
+ * produces it, so a funnel built from them has no denominator that survives the
9
+ * early exits. Delivered through `DiagnosticsOutbox` (reliable, not
10
+ * fire-and-forget), and built from exactly one call site: `#recordPlacementResolved`
11
+ * in `Encore.ts`, which `show()`'s outer wrapper calls once.
12
+ *
13
+ * Two shape decisions worth stating up front, because both look like omissions:
14
+ *
15
+ * `advertiser_outcome` never carries `'verified'` on web. iOS's sheet blocks on the
16
+ * strict-unlock verification poll and can therefore fold the result into its terminal
17
+ * record; web's poll runs detached so it cannot race the modal's own close listeners
18
+ * (docs/architecture/platform-divergence/web.md #3). The fact is not lost — it is
19
+ * reported by `sdk_offer_verified`, joinable back on `presentation_id` in session or
20
+ * `transaction_id` across sessions. A cross-platform dashboard segmenting on
21
+ * `advertiser_outcome` alone will see web permanently at 0% verified; that is the
22
+ * documented shape, not a bug.
23
+ *
24
+ * `publisher_outcome` is REQUIRED and always `'not_attempted'`. The record reports
25
+ * what Encore did at the moment its flow ended, and Encore did not attempt a
26
+ * purchase — whether because web has no purchase controller at all, or because this
27
+ * particular flow did not use one, or because the use case is a reward. All three are
28
+ * the same observable fact here. Making it optional would smuggle in a second "does
29
+ * this platform even have the capability" dimension the record is not meant to carry.
30
+ */
31
+ import type { AnalyticsEvent } from './models';
32
+ import type { ShowResult } from '../types';
33
+ import type { WireUseCase } from '../core/useCase';
34
+ /**
35
+ * NOT `'verified'` (see the file header). NOT `'cooldown'` either: the
36
+ * provisional-cooldown mechanism it describes is still unmerged backend-side, so a
37
+ * value for it would name something that cannot happen yet.
38
+ */
39
+ export type AdvertiserOutcome = 'not_attempted' | 'claimed' | 'failed';
40
+ /** iOS/Android's wire values verbatim. Web emits only the first — see the header. */
41
+ export type PublisherOutcome = 'not_attempted' | 'purchased' | 'cancelled' | 'pending' | 'failed';
42
+ export type Resolution = 'not_presented' | 'presented';
43
+ export type NotPresentedReason =
44
+ /**
45
+ * Mapped from the `notConfigured` result, though no row can actually carry it:
46
+ * the outbox does not exist before configure(), so that path produces nothing to
47
+ * deliver. Mapped anyway so the translation is correct the day a diagnostic
48
+ * channel exists that early — iOS has the same blind spot, its enqueue being a
49
+ * no-op while services are nil.
50
+ */
51
+ 'not_configured' | 'already_presenting' | 'no_offer_available' | 'experiment_control' | 'use_case_unavailable'
52
+ /** `error.<ErrorCode>`, lowercased. */
53
+ | `error.${string}`;
54
+ export type Dismissal =
55
+ /** `userClosedModal` — the × and Escape. */
56
+ 'close_button'
57
+ /**
58
+ * `userClickedOutside`. iOS's generic catch-all, not `swipe_dismiss`: that names a
59
+ * mobile gesture a browser backdrop tap is not.
60
+ */
61
+ | 'dismissed'
62
+ /** `userDeclinedLastOffer`. */
63
+ | 'last_offer_declined'
64
+ /** A claim succeeded and the sheet closed itself. */
65
+ | 'flow_completed'
66
+ /** An unexpected failure after the sheet was already in play. */
67
+ | 'interrupted';
68
+ /**
69
+ * The three independent axes of a presented flow — iOS's
70
+ * `PresentationResult.Outcome` (`PresentationResult.swift:141`), field for field.
71
+ *
72
+ * All three are REQUIRED together. `'not_attempted'` is a real value meaning "the
73
+ * funnel was open and nothing entered it", which is a different fact from the axis
74
+ * being absent — and absent is not a state a presented row has. A row missing one
75
+ * of these is not a smaller row, it is an unreadable one: a dashboard cannot tell
76
+ * "nothing happened on this axis" from "the SDK forgot to say".
77
+ */
78
+ export interface PresentedOutcome {
79
+ advertiserOutcome: AdvertiserOutcome;
80
+ /** Always `'not_attempted'` on web today — see the file header. */
81
+ publisherOutcome: PublisherOutcome;
82
+ dismissal: Dismissal;
83
+ }
84
+ /** Identity of what was claimed, carried only when the advertiser funnel got there. */
85
+ interface ClaimIdentity {
86
+ campaignId?: string;
87
+ offerId?: string;
88
+ transactionId?: string;
89
+ }
90
+ /**
91
+ * The outcome half of the record, as a discriminated union rather than a bag of
92
+ * optionals — so the three-axis invariant is a compile error to break, not a
93
+ * convention to remember. Mirrors iOS's `enum PresentationResult { case
94
+ * notPresented(reason); case presented(Outcome) }`.
95
+ *
96
+ * The two branches share NO outcome fields: a `not_presented` row carries a reason
97
+ * and nothing else, exactly as iOS's wire assembly does
98
+ * (`OfferEvents+Outbox.swift:76-90`). Publishing `publisher_outcome:
99
+ * 'not_attempted'` on a row where no sheet ever appeared would be reporting on a
100
+ * funnel that never opened.
101
+ */
102
+ export type PlacementOutcomeFields = {
103
+ resolution: 'not_presented';
104
+ notPresentedReason: NotPresentedReason;
105
+ } | ({
106
+ resolution: 'presented';
107
+ } & PresentedOutcome & ClaimIdentity);
108
+ /** The record's identity fields, present on every row regardless of resolution. */
109
+ export interface PlacementResolvedContext {
110
+ placementId?: string;
111
+ presentationId: string;
112
+ useCase: WireUseCase;
113
+ unlockMode: 'strict' | 'optimistic';
114
+ variantId?: string;
115
+ }
116
+ export type PlacementResolvedProperties = PlacementResolvedContext & PlacementOutcomeFields;
117
+ export declare function placementResolved(distinctId: string, properties: PlacementResolvedProperties): AnalyticsEvent;
118
+ /**
119
+ * What a resolving site must state explicitly, because the public `ShowResult`
120
+ * collapses it and no mapper can recover it:
121
+ *
122
+ * - `{status:'unavailable'}` is deliberately overloaded — no eligible offers, NCL
123
+ * control cohort, and use case not enabled all share it, so an integrator cannot
124
+ * reverse-engineer the incrementality experiment from a return value. The record
125
+ * still needs to tell them apart.
126
+ * - `UNKNOWN_ERROR` is produced by three structurally different sites: a failure
127
+ * before the sheet ever rendered, a rendering failure with no claim attempted, and
128
+ * a claim whose transaction write failed. The code alone cannot distinguish them.
129
+ *
130
+ * Every other case — a claim, a string `NotGrantedReason`, a distinctly-coded error —
131
+ * is fully derivable, and an override for those is unnecessary though harmless: it
132
+ * always wins.
133
+ */
134
+ export interface PlacementResolutionOverride {
135
+ notPresentedReason?: NotPresentedReason;
136
+ advertiserOutcome?: AdvertiserOutcome;
137
+ dismissal?: Dismissal;
138
+ }
139
+ export type DerivedPlacementResolvedFields = PlacementOutcomeFields;
140
+ /**
141
+ * Pure mapper: a `ShowResult` (plus a disambiguating override where the result
142
+ * collapses one) to the record's outcome fields.
143
+ *
144
+ * `ShowResult`'s claimed member already carries `campaignId`/`offerId`/
145
+ * `transactionId` inline, so nothing else has to be threaded here to identify what
146
+ * was claimed.
147
+ */
148
+ export declare function deriveResolvedFields(result: ShowResult, override?: PlacementResolutionOverride): DerivedPlacementResolvedFields;
149
+ export {};
150
+ //# sourceMappingURL=placementResolved.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"placementResolved.d.ts","sourceRoot":"","sources":["../../src/analytics/placementResolved.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAA+B,UAAU,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EA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CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;IACrB,UAAU,EAAE,QAAQ,GAAG,YAAY,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,GAAG,sBAAsB,CAAC;AAE5F,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,2BAA2B,GACtC,cAAc,CAchB;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,2BAA2B;IAC1C,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IACxC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAYD,MAAM,MAAM,8BAA8B,GAAG,sBAAsB,CAAC;AAsBpE;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,EAClB,QAAQ,CAAC,EAAE,2BAA2B,GACrC,8BAA8B,CAyEhC"}
@@ -46,8 +46,14 @@ export declare class APIClient {
46
46
  * turn this best-effort label into a hard failure of the entire offers fetch for
47
47
  * a publisher who simply named their placement something long. Truncating keeps
48
48
  * the analytics label degraded-but-present instead of losing the offer entirely.
49
+ *
50
+ * `maxPostbackTimeMs` is strict-unlock mode's offer filter — only campaigns whose
51
+ * postback latency fits the verification window. It is a fixed SDK constant
52
+ * (`StrictUnlock.MAX_POSTBACK_TIME_MS`), never publisher input, so unlike
53
+ * `placementId` there is nothing to bound here: the contract's own 1000..120000
54
+ * range (`offers/dto.ts`) cannot be violated by a caller.
49
55
  */
50
- fetchOffers(userId: string, attributes: UserAttributes, placementId?: string): Promise<{
56
+ fetchOffers(userId: string, attributes: UserAttributes, placementId?: string, maxPostbackTimeMs?: number): Promise<{
51
57
  offers: OfferModel[];
52
58
  }>;
53
59
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"APIClient.d.ts","sourceRoot":"","sources":["../../src/api/APIClient.ts"],"names":[],"mapp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AK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7C,OAAO,CAAC,gBAAgB,CAAC;IAa5B;;OAEG;IACG,YAAY,CAChB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7C,OAAO,CAAC,oBAAoB,CAAC;IAchC;;;;;;;;;;;;;;;;;OAiBG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,OAAO,GAChB,OAAO,CAAC,oBAAoB,CAAC;IAehC;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACnC,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBjB;;OAEG;IACG,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAW3D"}
@@ -34,6 +34,11 @@ export declare class Configuration {
34
34
  * Get environment
35
35
  */
36
36
  getEnvironment(): string | null;
37
+ /**
38
+ * When a claim counts as confirmed — `'optimistic'` (default) at advertiser
39
+ * handoff, or `'strict'` only once the advertiser postback verifies it.
40
+ */
41
+ getUnlockMode(): 'strict' | 'optimistic';
37
42
  /**
38
43
  * Reset configuration (primarily for testing)
39
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/core/Configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAQ7C,qBAAa,aAAa;;IAIxB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO;IA0FxC;;OAEG;IACH,SAAS,IAAI,YAAY,GAAG,IAAI;IAIhC;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;OAEG;IACH,UAAU,IAAI,MAAM,GAAG,IAAI;IAI3B;;OAEG;IACH,mBAAmB,IAAI,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B;;OAEG;IACH,KAAK,IAAI,IAAI;CAKd"}
1
+ {"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/core/Configuration.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAS7C,qBAAa,aAAa;;IAIxB;;;OAGG;IACH,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO;IA+FxC;;OAEG;IACH,SAAS,IAAI,YAAY,GAAG,IAAI;IAIhC;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;OAEG;IACH,UAAU,IAAI,MAAM,GAAG,IAAI;IAI3B;;OAEG;IACH,mBAAmB,IAAI,MAAM,GAAG,IAAI;IAIpC;;OAEG;IACH,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B;;;OAGG;IACH,aAAa,IAAI,QAAQ,GAAG,YAAY;IAIxC;;OAEG;IACH,KAAK,IAAI,IAAI;CAKd"}
@@ -38,6 +38,22 @@ export declare class EncoreSDK {
38
38
  * Get SDK version
39
39
  */
40
40
  getVersion(): string;
41
+ /**
42
+ * Whether the sheet's claim affordances are live. Mirrors iOS's
43
+ * `Encore.shared.isClaimEnabled` (`Encore.swift:64`), including its default of
44
+ * `true` and its scope: it gates the CLAIM action only.
45
+ *
46
+ * Set it to `false` when the host knows a claim cannot succeed right now — an
47
+ * account in a state the advertiser will reject, a region the campaign does not
48
+ * serve — and the honest thing is to show the offer without letting the user act
49
+ * on it. The sheet still renders in full, and dismissal is always available: a
50
+ * user must be able to leave a sheet they cannot use.
51
+ *
52
+ * Read when the sheet is built, so it applies from the next `show()` onward
53
+ * rather than mid-presentation.
54
+ */
55
+ get isClaimEnabled(): boolean;
56
+ set isClaimEnabled(enabled: boolean);
41
57
  /**
42
58
  * Whether configure() has been called successfully.
43
59
  */
@@ -127,6 +143,26 @@ export declare class EncoreSDK {
127
143
  observeEntitlement(_entitlement: EntitlementType, _scope?: EntitlementScope): {
128
144
  subscribe: (callback: (isActive: boolean) => void) => Unsubscribe;
129
145
  };
146
+ /**
147
+ * Strict-unlock mode only: subscribe to a claim's advertiser postback being
148
+ * verified AFTER `show()` already resolved — either a fast in-session
149
+ * verification or one recovered on a later page load. `show()`'s `'claimed'`
150
+ * result reports the handoff and never carries a verified flag, so this is the
151
+ * one channel for both cases.
152
+ *
153
+ * Mirrors what iOS's `Encore.shared.outcomes` stream and Android's
154
+ * `outcomes: SharedFlow<PlacementOutcome>` deliver for the same scenario. Scoped
155
+ * to this one event rather than a general outcomes channel because it is the only
156
+ * case web's return-value-per-call model cannot cover: a verification recovered on
157
+ * a later page load has no `show()` call in flight to resolve.
158
+ *
159
+ * The callback receives the transaction id and nothing else — by the time a late
160
+ * verification lands there is no offer or presentation left in scope, on any
161
+ * platform. Never fires in `'optimistic'` mode (the default): nothing is polled.
162
+ *
163
+ * @returns an unsubscribe function.
164
+ */
165
+ onStrictUnlockVerified(callback: (transactionId: string) => void): Unsubscribe;
130
166
  /**
131
167
  * Create placement builder for fluent API
132
168
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Encore.d.ts","sourceRoot":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,43 @@ export declare class OfferManager {
10
10
  #private;
11
11
  constructor(apiClient: APIClient, userId: string, analyticsClient?: AnalyticsClient);
12
12
  /**
13
- * Fetch offers from API with optional caching
13
+ * Fetch offers from API with optional caching.
14
+ *
15
+ * `maxPostbackTimeMs` (strict-unlock mode only) narrows the eligible set to
16
+ * campaigns whose postback latency fits the verification window. Because it
17
+ * changes WHICH offers come back, such a fetch neither reads nor writes the
18
+ * cache: a cached optimistic-mode set would leak unverifiable campaigns into a
19
+ * strict presentation, and caching the narrowed set would starve a later
20
+ * optimistic one. Matches iOS.
14
21
  */
15
- fetchOffers(userAttributes: UserAttributes, useCache?: boolean, placementId?: string): Promise<{
22
+ fetchOffers(userAttributes: UserAttributes, useCache?: boolean, placementId?: string, maxPostbackTimeMs?: number): Promise<{
16
23
  offers: OfferModel[];
17
24
  }>;
18
25
  /**
19
26
  * Begin a new presentation session. `variantId` is the SDUI variant this
20
27
  * presentation renders — stamped onto every event the session emits — and
21
28
  * `useCase` is retained so the page-lifecycle flush can stamp it too.
29
+ *
30
+ * `presentationId` is the ATTEMPT's id, minted by the caller before the flow
31
+ * started, so the events emitted here carry the same id as the ones emitted
32
+ * before a presentation session existed at all. Minting one here when the caller
33
+ * has none keeps this class usable standalone; Encore.ts always passes one.
34
+ */
35
+ /**
36
+ * `presentationId` is optional and the caller almost never passes it. `show()` mints
37
+ * the id before its first gate, so a presentation that never reaches this method
38
+ * still has one to report under; passing it here is what keeps that early id and the
39
+ * presentation's own id the same value. Absent a caller-supplied one this still mints,
40
+ * which is the behaviour every non-`show()` entry point relies on.
41
+ */
42
+ beginPresentation(variantId?: string, useCase?: UseCase, placementId?: string, presentationId?: string): string;
43
+ /**
44
+ * The live presentation's placement label, or undefined when the publisher gave
45
+ * none. Exposed for the strict-unlock pending record, which has to persist the
46
+ * dimension at claim time because the presentation holding it is gone by the time a
47
+ * cross-session verification lands.
22
48
  */
23
- beginPresentation(variantId?: string, useCase?: UseCase, placementId?: string): string;
49
+ get placementId(): string | undefined;
24
50
  /** The live presentation's id, or null between presentations. */
25
51
  get presentationId(): string | null;
26
52
  /**
@@ -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,OAAO,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAMpE,qBAAa,YAAY;;gBAkDX,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,eAAe;IAOnF;;OAEG;IACG,WAAW,CACf,cAAc,EAAE,cAAc,EAC9B,QAAQ,UAAO,EACf,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC;QAAE,MAAM,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IAmCpC;;;;OAIG;IACH,iBAAiB,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM;IAatF,iEAAiE;IACjE,IAAI,cAAc,IAAI,MAAM,GAAG,IAAI,CAElC;IAiBD;;OAEG;IACH,mBAAmB,CACjB,KAAK,EAAE,UAAU,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,OAAO,GAChB,IAAI;IA8CP;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAQxC;;OAEG;IACH,iBAAiB,CACf,KAAK,EAAE,UAAU,EACjB,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,WAAW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B,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAwCjE,kEAAkE;IAClE,OAAO,IAAI,IAAI;IAKf;;OAEG;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"}
@@ -12,6 +12,18 @@ export declare class PlacementBuilder implements IPlacementBuilder {
12
12
  * the native SDKs expose, so a cross-platform integration reads the same here.
13
13
  */
14
14
  useCase(useCase: UseCase): PlacementBuilder;
15
+ /**
16
+ * Override the sheet's headline for this presentation — the same
17
+ * `.headline(...)` step the native SDKs expose.
18
+ *
19
+ * Identical in effect to passing `headline` in {@link PlacementOptions}: the
20
+ * per-call override beats the backend-resolved copy, which beats the built-in
21
+ * fallback. A blank or whitespace-only value falls THROUGH to the resolved copy
22
+ * rather than blanking the sheet, so it can never erase shipped copy.
23
+ */
24
+ headline(text: string): PlacementBuilder;
25
+ /** Counterpart to {@link headline}: same precedence, same blank-falls-through rule. */
26
+ subheadline(text: string): PlacementBuilder;
15
27
  /**
16
28
  * Set callback for when user declines or offer not granted
17
29
  */
@@ -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,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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AgB;IAK9E;;;;;OAKG;IACG,IAAI,IAAI,OAAO,CAAC,UAAU,CAAC;CA6ClC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Strict-unlock mode constants.
3
+ *
4
+ * One source of truth so the verification poll window and the `maxPostbackTimeMs`
5
+ * offer filter cannot drift apart — the same reason iOS ties them together in
6
+ * `StrictUnlock.swift`: serving an offer whose postback SLA cannot plausibly land
7
+ * inside the window the poller is willing to wait guarantees a claim that never
8
+ * verifies in session.
9
+ */
10
+ /** How long a verification poll waits before giving up. Mirrors iOS's 15s. */
11
+ export declare const POLL_TIMEOUT_MS = 15000;
12
+ /** Sent as `maxPostbackTimeMs` on `/offers/search` — strict mode only. */
13
+ export declare const MAX_POSTBACK_TIME_MS = 15000;
14
+ /**
15
+ * How long a pending claim is retried across sessions before it is dropped. Past
16
+ * this the campaign's postback window is long gone and the row will never verify.
17
+ * Mirrors iOS's `StrictUnlockReconciler.maxAge`.
18
+ */
19
+ export declare const RECONCILE_MAX_AGE_MS: number;
20
+ //# sourceMappingURL=StrictUnlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StrictUnlock.d.ts","sourceRoot":"","sources":["../../src/core/StrictUnlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,QAAkB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAuB,CAAC"}