@kameleoon/react-sdk 10.19.3 → 10.21.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.21.0 (2026-03-04)
4
+
5
+ ### Features
6
+
7
+ - Introduced a new [`flushInstant`][flush] method — an asynchronous version of `flush` that returns `Promise<void>` and can be awaited:
8
+ - Use `await flushInstant(visitorCode)` to send tracking requests immediately and wait for completion.
9
+ - Use `await flushInstant()` to send tracking requests immediately for all visitors.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+ - @kameleoon/javascript-sdk@4.19.0
15
+
16
+ ## 10.20.0 (2026-02-13)
17
+
18
+ ### Features
19
+
20
+ - Updated the allowed range for the [`trackingInterval`][configurationParameters]. The new range is from **`1000` ms** (default) to **`5000` ms**, allowing a reduction in the number of tracking requests.
21
+ - Introduced a new `track` parameter for [`addData`][addData]. When set to `false`, the data is stored locally and used only for targeting evaluation; it is not sent to the Data API, helping to prevent duplicate data from being recorded. The default value is `true`. This behavior is consistent with the `track` parameter used in evaluation methods such as [`getVariation`][getVariation].
22
+
23
+ [configurationParameters](https://developers.kameleoon.com/feature-management-and-experimentation/web-sdks/react-js-sdk/#configuration-parameters)
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+ - @kameleoon/javascript-sdk@4.18.0
29
+
3
30
  ## 10.19.2 (2026-02-09)
4
31
 
5
32
  > [!WARNING]
@@ -27,6 +27,28 @@ export default interface IUseData {
27
27
  * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed it's `initialize` call.
28
28
  */
29
29
  flush: (visitorCode?: string, instant?: boolean) => void;
30
+ /**
31
+ * Sends visitor-associated Kameleoon tracking data immediately.
32
+ * The collected data is sent in a tracking request and then removed from the `KameleoonClient`
33
+ * instance, but it remains in storage for correct targeting checks.
34
+ *
35
+ * If no visitor code is provided, the data for all visitors is sent and removed from the
36
+ * `KameleoonClient` instance. Before sending the current data, the method first attempts
37
+ * to resend any previously failed tracking requests that were stored locally during offline mode.
38
+ *
39
+ * This method sends the data instantly and returns a Promise that resolves when the
40
+ * tracking requests have been processed, allowing the caller to wait for completion.
41
+ *
42
+ * @param {string | undefined} visitorCode - Unique visitor identification string.
43
+ * Cannot exceed 255 characters in length. If omitted, data for all visitors is sent.
44
+ * @returns {Promise<void>} A promise that resolves when the flush operation completes.
45
+ *
46
+ * @throws `KameleoonError` with one of the following `type`s:
47
+ * - `KameleoonException.VisitorCodeMaxLength` - The visitor code length was exceeded
48
+ * - `KameleoonException.VisitorCodeEmpty` - The visitor code is empty
49
+ * - `KameleoonException.Initialization` - Method was executed before the `kameleoonClient` completed its `initialize` call
50
+ */
51
+ flushInstant: (visitorCode?: string) => Promise<void>;
30
52
  /**
31
53
  * Creates and adds `Conversion` data to the visitor with specified parameters and executes `flushData`. Note: it's a helper method for the quick and convenient conversion tracking, however creating and adding `Conversion` manually allows more flexible `Conversion` with `negative` parameter.
32
54
  *