Skip to content

Commit 03c40b8

Browse files
Merge pull request #491 from splitio/sdk-configs-baseline
[SDK Configs] Baseline
2 parents c6fe211 + e76a404 commit 03c40b8

212 files changed

Lines changed: 5910 additions & 3229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"root": true,
23
"extends": [
34
"eslint:recommended"
45
],
@@ -46,7 +47,7 @@
4647
"overrides": [
4748
{
4849
"env": {
49-
// platform-agnostic code must not reference Node or Browser globals
50+
// platform-agnostic code must not reference Node or Browser globals without feature detection
5051
"node": false,
5152
"browser": false,
5253
"es6": true

CHANGES.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
3.0.0 (June 26, 2026)
2+
- Extracted SDK lifecycle methods (`init`, `flush`, and `destroy`) into a reusable `sdkLifecycle` module.
3+
- Extracted the `track` method into a standalone `trackMethod` factory for reuse across SDKs.
4+
- Added a bloom filter utility and platform-specific modules (`src/platform/`) for reuse across SDKs.
5+
- Added support for the Configs SDK:
6+
- new type declarations,
7+
- fallback calculator with sanitizer,
8+
- default treatment evaluation (without a target),
9+
- new `CONFIGS_UPDATE` metadata type for `SDK_UPDATE` event,
10+
- optional `entityType` field in the `/testImpressions/bulk` payload,
11+
- input validation for the target object.
12+
- Removed the misleading warning log 'No listeners for SDK_READY event detected', since users can use the `whenReady` method to wait for the SDK to be ready.
13+
- BREAKING CHANGES: Renamed some types and modules, and updated the signatures of others for clarity and reusability.
14+
115
2.12.1 (June 25, 2026)
216
- Updated internal modules to handle `null` values from `/splitChanges` response.
317
- Updated some dependencies for vulnerability fixes.

package-lock.json

Lines changed: 111 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@splitsoftware/splitio-commons",
3-
"version": "2.12.1",
3+
"version": "3.0.0",
44
"description": "Split JavaScript SDK common components",
55
"main": "cjs/index.js",
66
"module": "esm/index.js",
@@ -49,11 +49,19 @@
4949
"tslib": "^2.3.1"
5050
},
5151
"peerDependencies": {
52-
"ioredis": "^4.28.0 || ^5.0.0"
52+
"bloom-filters": "^3.0.0",
53+
"ioredis": "^4.28.0 || ^5.0.0",
54+
"node-fetch": "^2.7.0"
5355
},
5456
"peerDependenciesMeta": {
57+
"bloom-filters": {
58+
"optional": true
59+
},
5560
"ioredis": {
5661
"optional": true
62+
},
63+
"node-fetch": {
64+
"optional": true
5765
}
5866
},
5967
"devDependencies": {
@@ -62,6 +70,7 @@
6270
"@types/lodash": "^4.14.162",
6371
"@typescript-eslint/eslint-plugin": "^7.18.0",
6472
"@typescript-eslint/parser": "^7.18.0",
73+
"bloom-filters": "^3.0.4",
6574
"cross-env": "^7.0.2",
6675
"eslint": "^8.56.0",
6776
"eslint-plugin-compat": "^6.0.1",

src/__tests__/testUtils/jwt.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { IJwtCredentialV3 } from '../../sync/streaming/AuthClient/types';
2+
3+
function toBase64Url(str: string) {
4+
return Buffer.from(str).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
5+
}
6+
7+
export function makeJwtCredential(expInSeconds = 3600): IJwtCredentialV3 {
8+
const now = Math.floor(Date.now() / 1000);
9+
const header = toBase64Url(JSON.stringify({ alg: 'HS256' }));
10+
const decodedToken = { iat: now, exp: now + expInSeconds, 'x-ably-capability': '{"ch":["subscribe"]}' };
11+
const payload = toBase64Url(JSON.stringify(decodedToken));
12+
13+
return {
14+
token: `${header}.${payload}.sig`,
15+
decodedToken,
16+
channels: { ch: ['subscribe'] },
17+
config: {
18+
streaming: {
19+
enabled: true,
20+
delay: 60,
21+
}
22+
}
23+
};
24+
}

0 commit comments

Comments
 (0)