@encorekit/web-sdk 2.1.4 → 2.2.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.
- package/README.md +20 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/umd/encore.min.js +1 -1
- package/dist/umd/encore.min.js.map +1 -1
- package/package.json +1 -1
- package/types/analytics/events.d.ts +54 -2
- package/types/analytics/events.d.ts.map +1 -1
- package/types/api/APIClient.d.ts +15 -1
- package/types/api/APIClient.d.ts.map +1 -1
- package/types/api/generated/types.d.ts +94 -7
- package/types/api/generated/types.d.ts.map +1 -1
- package/types/api/models.d.ts +7 -0
- package/types/api/models.d.ts.map +1 -1
- package/types/core/Configuration.d.ts +2 -0
- package/types/core/Configuration.d.ts.map +1 -1
- package/types/core/Encore.d.ts.map +1 -1
- package/types/core/giftVariant.d.ts +11 -6
- package/types/core/giftVariant.d.ts.map +1 -1
- package/types/core/share.d.ts +58 -0
- package/types/core/share.d.ts.map +1 -0
- package/types/core/unlockCode.d.ts +25 -0
- package/types/core/unlockCode.d.ts.map +1 -0
- package/types/core/version.d.ts +1 -1
- package/types/types.d.ts +61 -8
- package/types/types.d.ts.map +1 -1
- package/types/ui/CodeUnlock.d.ts +151 -0
- package/types/ui/CodeUnlock.d.ts.map +1 -0
- package/types/ui/GiftSheet.d.ts +47 -3
- package/types/ui/GiftSheet.d.ts.map +1 -1
- package/types/ui/GiftUnwrap.d.ts +70 -0
- package/types/ui/GiftUnwrap.d.ts.map +1 -1
- package/types/ui/OfferModal.d.ts +30 -0
- package/types/ui/OfferModal.d.ts.map +1 -1
- package/types/ui/giftUnwrapArt.d.ts +6 -0
- package/types/ui/giftUnwrapArt.d.ts.map +1 -1
- package/types/ui/giftUnwrapCopy.d.ts +20 -0
- package/types/ui/giftUnwrapCopy.d.ts.map +1 -1
- package/types/ui/styles.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -334,6 +334,26 @@ round trip.
|
|
|
334
334
|
> thing that blocks serving, and it is deliberate — it is how a live surface is
|
|
335
335
|
> stopped without a deploy. A switched-off surface no-ops exactly as below.
|
|
336
336
|
|
|
337
|
+
### Per-placement reward variants (opt-in)
|
|
338
|
+
|
|
339
|
+
Encore can serve a different reward variant per placement label, for example a
|
|
340
|
+
code screen for `'email_code'` and the plain gift picker for `'email'`. The
|
|
341
|
+
variant prefetched at `configure()` cannot carry that choice, so ask for it:
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
Encore.configure({ apiKey: 'your-api-key-here', resolveVariantsByPlacement: true });
|
|
345
|
+
|
|
346
|
+
// One GET /config?useCase=post-action-reward&placementId=email_code before the
|
|
347
|
+
// sheet renders; the variant it names is presented and reported.
|
|
348
|
+
await Encore.placement('email_code', { useCase: 'rewardUsers' }).show();
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
A settled answer is reused for that label for the rest of the session (until
|
|
352
|
+
`reset()`), while a failed or discarded request is retried on the next
|
|
353
|
+
presentation. A failed or slow request falls back to what the SDK does with the option off (the
|
|
354
|
+
prefetched variant, or the on-demand fetch when there is none); it never blocks
|
|
355
|
+
or breaks the presentation. Off (the default), the SDK's requests are unchanged.
|
|
356
|
+
|
|
337
357
|
### When nothing presents
|
|
338
358
|
|
|
339
359
|
A use case that cannot be served resolves `{ status: 'unavailable' }`, reports
|