@encorekit/web-sdk 2.0.7 → 2.1.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 (68) hide show
  1. package/README.md +6 -0
  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 +1 -1
  9. package/types/api/APIClient.d.ts +18 -0
  10. package/types/api/APIClient.d.ts.map +1 -1
  11. package/types/api/generated/types.d.ts +177 -2
  12. package/types/api/generated/types.d.ts.map +1 -1
  13. package/types/api/models.d.ts +32 -0
  14. package/types/api/models.d.ts.map +1 -1
  15. package/types/core/Encore.d.ts.map +1 -1
  16. package/types/core/giftVariant.d.ts +67 -0
  17. package/types/core/giftVariant.d.ts.map +1 -0
  18. package/types/core/version.d.ts +1 -1
  19. package/types/types.d.ts +31 -3
  20. package/types/types.d.ts.map +1 -1
  21. package/types/ui/GiftHero.d.ts +75 -0
  22. package/types/ui/GiftHero.d.ts.map +1 -0
  23. package/types/ui/GiftList.d.ts +110 -0
  24. package/types/ui/GiftList.d.ts.map +1 -0
  25. package/types/ui/GiftReveal.d.ts +133 -0
  26. package/types/ui/GiftReveal.d.ts.map +1 -0
  27. package/types/ui/GiftSheet.d.ts +126 -0
  28. package/types/ui/GiftSheet.d.ts.map +1 -0
  29. package/types/ui/GiftUnwrap.d.ts +155 -0
  30. package/types/ui/GiftUnwrap.d.ts.map +1 -0
  31. package/types/ui/OfferCarousel.d.ts +10 -3
  32. package/types/ui/OfferCarousel.d.ts.map +1 -1
  33. package/types/ui/OfferModal.d.ts +7 -0
  34. package/types/ui/OfferModal.d.ts.map +1 -1
  35. package/types/ui/RewardActions.d.ts +88 -4
  36. package/types/ui/RewardActions.d.ts.map +1 -1
  37. package/types/ui/RewardCard.d.ts +16 -8
  38. package/types/ui/RewardCard.d.ts.map +1 -1
  39. package/types/ui/RewardConfetti.d.ts +23 -1
  40. package/types/ui/RewardConfetti.d.ts.map +1 -1
  41. package/types/ui/RewardLayout.d.ts +35 -0
  42. package/types/ui/RewardLayout.d.ts.map +1 -1
  43. package/types/ui/advertiserPreconnect.d.ts +90 -0
  44. package/types/ui/advertiserPreconnect.d.ts.map +1 -0
  45. package/types/ui/appearance.d.ts +27 -0
  46. package/types/ui/appearance.d.ts.map +1 -1
  47. package/types/ui/focusable.d.ts +41 -0
  48. package/types/ui/focusable.d.ts.map +1 -0
  49. package/types/ui/giftCategoryGroups.d.ts +21 -0
  50. package/types/ui/giftCategoryGroups.d.ts.map +1 -0
  51. package/types/ui/giftCopy.d.ts +215 -0
  52. package/types/ui/giftCopy.d.ts.map +1 -0
  53. package/types/ui/giftUnwrapArt.d.ts +55 -0
  54. package/types/ui/giftUnwrapArt.d.ts.map +1 -0
  55. package/types/ui/giftUnwrapCopy.d.ts +57 -0
  56. package/types/ui/giftUnwrapCopy.d.ts.map +1 -0
  57. package/types/ui/impressionGate.d.ts +63 -0
  58. package/types/ui/impressionGate.d.ts.map +1 -0
  59. package/types/ui/offerBadge.d.ts +56 -0
  60. package/types/ui/offerBadge.d.ts.map +1 -0
  61. package/types/ui/rewardSurface.d.ts +82 -0
  62. package/types/ui/rewardSurface.d.ts.map +1 -0
  63. package/types/ui/safeImageSrc.d.ts +10 -0
  64. package/types/ui/safeImageSrc.d.ts.map +1 -1
  65. package/types/ui/styles.d.ts +166 -0
  66. package/types/ui/styles.d.ts.map +1 -1
  67. package/types/ui/termsLine.d.ts +33 -0
  68. package/types/ui/termsLine.d.ts.map +1 -0
package/README.md CHANGED
@@ -62,6 +62,12 @@ Encore.identify('user-123', {
62
62
  subscriptionTier: 'free'
63
63
  });
64
64
 
65
+ // Already know the user at load time (a login, or the userId on a hosted offer
66
+ // link)? Name them at configure instead, so the SDK's very first request — the
67
+ // /config that assigns experiment arms — runs as that user, not as an anonymous
68
+ // id it then abandons. A stored anonymous id is aliased to it as identify() would.
69
+ // Encore.configure({ apiKey: 'your-api-key-here', environment: 'production', userId: 'user-123' });
70
+
65
71
  // Present a placement — defaults to the 'reduceChurn' use case
66
72
  const result = await Encore.show();
67
73
  if (result.status === 'claimed') {