@kameleoon/react-sdk 10.4.0 → 10.6.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 +30 -1
- package/README.md +18 -0
- package/dist/createClient.d.ts +1 -1
- package/dist/createClient.js +1 -1
- package/dist/types.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,35 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 10.
|
|
3
|
+
## 10.6.0 (2025-02-26)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- Added new parameter `stubMode` to `SDKParameters` for create `KameleoonClient`. This parameter enables a no-operation mode for the client, which is particularly useful for disabling external interactions in controlled environments.
|
|
8
|
+
- Added SDK support for **Mutually Exclusive Groups**. When feature flags are grouped into a **Mutually Exclusive Group**, only one flag in the group will be evaluated at a time. All other flags in the group will automatically return their default variation.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Fixed validation for the [`networkDomain`][configurationParameters] parameter.
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @kameleoon/javascript-sdk@4.6.0
|
|
15
|
+
|
|
16
|
+
## 10.5.0 (2025-02-10)
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
- Added SDK support for **holdout experiments**. Visitors assigned to a holdout experiment are excluded from all other rollouts and experiments, and consistently receive the default variation. For visitors not in a holdout experiment, the standard evaluation process applies, allowing them to be evaluated for all feature flags as usual. Platform-wide release expected in February 2025.
|
|
21
|
+
- Introduced a new `personalization` parameter to [`RemoteVisitorDataFilter`][getRemoteVisitorData]. Default value of the parameter is `false`.
|
|
22
|
+
- The following targeting conditions are now supported:
|
|
23
|
+
- Exclusive Campaign
|
|
24
|
+
- Experiment
|
|
25
|
+
- Personalization
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- Updated dependencies
|
|
30
|
+
- @kameleoon/javascript-sdk@4.5.0
|
|
31
|
+
|
|
32
|
+
## 10.4.0 (2025-01-20)
|
|
4
33
|
|
|
5
34
|
### Features
|
|
6
35
|
|
package/README.md
CHANGED
|
@@ -39,6 +39,24 @@ function MyComponentWrapper(): JSX.Element {
|
|
|
39
39
|
}
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
If used in Next.js for server-side rendering, you can set stubMode to disable SDK client initialization on the server.
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import { KameleoonProvider, createClient } from '@kameleoon/react-sdk';
|
|
46
|
+
|
|
47
|
+
const isServer = typeof window === 'undefined';
|
|
48
|
+
|
|
49
|
+
const client = createClient({ siteCode: 'my_site_code', stubMode: isServer });
|
|
50
|
+
|
|
51
|
+
function MyComponentWrapper(): JSX.Element {
|
|
52
|
+
return (
|
|
53
|
+
<KameleoonProvider client={client}>
|
|
54
|
+
<MyComponent />
|
|
55
|
+
</KameleoonProvider>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
42
60
|
## Usage Example
|
|
43
61
|
|
|
44
62
|
```tsx
|
package/dist/createClient.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ import { SDKParameters } from './types';
|
|
|
4
4
|
* Creates an instance of KameleoonClient
|
|
5
5
|
* @param parameters {SDKParameters} - parameters of an SDK
|
|
6
6
|
*/
|
|
7
|
-
export declare function createClient({ siteCode, configuration, externals, }: SDKParameters): KameleoonClient;
|
|
7
|
+
export declare function createClient({ siteCode, configuration, externals, stubMode, }: SDKParameters): KameleoonClient;
|
package/dist/createClient.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var _javascriptSdk=require("@kameleoon/javascript-sdk");Object.defineProperty(exports,"__esModule",{value:!0}),exports.createClient=createClient;function createClient(a){let{siteCode:b,configuration:c,externals:d}=a;const
|
|
1
|
+
"use strict";var _javascriptSdk=require("@kameleoon/javascript-sdk");Object.defineProperty(exports,"__esModule",{value:!0}),exports.createClient=createClient;function createClient(a){let{siteCode:b,configuration:c,externals:d,stubMode:e}=a;const f=new _javascriptSdk.KameleoonClient({siteCode:b,configuration:c,externals:d,_internals:{packageInfo:{type:_javascriptSdk.SdkLanguageType.REACT,version:"10.6.0",isServer:!1},prng:null===d||void 0===d?void 0:d.prng},stubMode:e});return f}
|
package/dist/types.d.ts
CHANGED
|
@@ -9,7 +9,9 @@ export type ExternalsType = CoreExternalsType & {
|
|
|
9
9
|
* @param {IExternalRequester | undefined} requester - external requester implementation
|
|
10
10
|
* @param {IExternalPRNG | undefined} prng - external PRNG implementation
|
|
11
11
|
* @param {IExternalLogger | undefined} logger - external logger implementation
|
|
12
|
+
* @param {boolean | undefined} stubMode - When set to true, the client will operate in stub mode and perform no operations. In this mode, all method calls become no-ops, ensuring that no external actions or side effects occur.
|
|
12
13
|
* */
|
|
13
14
|
export type SDKParameters = Omit<CoreSDKParameters, '_internals'> & {
|
|
14
15
|
externals?: ExternalsType;
|
|
16
|
+
stubMode?: boolean;
|
|
15
17
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kameleoon/react-sdk",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.6.0",
|
|
4
4
|
"description": "Kameleoon React SDK",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
],
|
|
40
40
|
"license": "ISC",
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@kameleoon/javascript-sdk": "4.
|
|
42
|
+
"@kameleoon/javascript-sdk": "4.6.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|