@inappstory/react-sdk 1.16.7 → 1.16.9

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.
@@ -18,6 +18,8 @@ export interface StoryReaderEvent {
18
18
  filter: Record<string, unknown>;
19
19
  /** User-generated payload (e.g., UGC data) */
20
20
  ugcPayload: Record<string, unknown>;
21
+ /** Custom attributes from the story payload */
22
+ extraFields?: Record<string, string>;
21
23
  /** Number of items in the default list */
22
24
  defaultListLength: number;
23
25
  /** Number of items in the favorites list */
@@ -90,6 +90,10 @@ export type IamEvents = {
90
90
  * The message that was closed
91
91
  */
92
92
  message: IamMessage;
93
+ /**
94
+ * Custom attributes from the message payload
95
+ */
96
+ extraFields?: Record<string, string>;
93
97
  };
94
98
 
95
99
  /**
@@ -114,6 +118,11 @@ export type IamEvents = {
114
118
  * Additional data associated with the event
115
119
  */
116
120
  data: Record<string, any>;
121
+
122
+ /**
123
+ * Custom attributes from the message payload
124
+ */
125
+ extraFields?: Record<string, string>;
117
126
  };
118
127
 
119
128
  /**
@@ -143,6 +152,11 @@ export type IamEvents = {
143
152
  * ID of the HTML element that was clicked
144
153
  */
145
154
  elementId: string;
155
+
156
+ /**
157
+ * Custom attributes from the message payload
158
+ */
159
+ extraFields?: Record<string, string>;
146
160
  };
147
161
  };
148
162
 
@@ -190,6 +204,7 @@ export interface InAppMessaging {
190
204
  * @param options - Optional display configuration
191
205
  * @param options.showOnlyIfLoaded - If true, only shows messages that were preloaded
192
206
  * @param options.signal - Abort signal to cancel the operation
207
+ * @param options.targeting - If true, the message will be displayed targeting the user
193
208
  * @param options.appearance - Client appearance overrides when opening the message
194
209
  * @param options.appearance.zIndex - Custom z-index for the message container
195
210
  * @param options.appearance.toast - Toast-specific overrides (when message type is Toast)
@@ -203,7 +218,12 @@ export interface InAppMessaging {
203
218
  */
204
219
  showMessageById(
205
220
  messageId: number | string,
206
- options?: { showOnlyIfLoaded?: boolean; signal?: AbortSignal; appearance?: IamClientAppearanceOptions }
221
+ options?: {
222
+ showOnlyIfLoaded?: boolean;
223
+ signal?: AbortSignal;
224
+ targeting?: boolean;
225
+ appearance?: IamClientAppearanceOptions;
226
+ }
207
227
  ): Promise<IamMessage>;
208
228
 
209
229
  /**
@@ -315,15 +315,17 @@ export declare class StoryManager {
315
315
  * Displays a specific story.
316
316
  * @param id The story ID
317
317
  * @param options.signal Abort signal to cancel the operation
318
+ * @param options.targeting Enable targeting for story fetch
318
319
  */
319
- showStory(id: number | string, options?: { signal?: AbortSignal }): Promise<void>;
320
+ showStory(id: number | string, options?: { signal?: AbortSignal; targeting?: boolean }): Promise<void>;
320
321
 
321
322
  /**
322
323
  * Displays a story only once.
323
324
  * @param id The story ID
324
325
  * @param options.signal Abort signal to cancel the operation
326
+ * @param options.targeting Enable targeting for story fetch
325
327
  */
326
- showStoryOnce(id: number | string, options?: { signal?: AbortSignal }): Promise<void>;
328
+ showStoryOnce(id: number | string, options?: { signal?: AbortSignal; targeting?: boolean }): Promise<void>;
327
329
 
328
330
  /**
329
331
  * Opens a game by its instance ID.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inappstory/react-sdk",
3
- "version": "1.16.7",
3
+ "version": "1.16.9",
4
4
  "description": "React SDK",
5
5
  "keywords": [
6
6
  "stories",