Skip to content

Commit cd9c6c1

Browse files
committed
Merge branch 'node-sdk-feature-definitions' of github.com:bucketco/bucket-javascript-sdk into node-sdk-feature-definitions
2 parents 043e836 + 38750ac commit cd9c6c1

File tree

5 files changed

+63
-25
lines changed

5 files changed

+63
-25
lines changed

packages/node-sdk/README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,13 @@ Install using `yarn` or `npm` with:
1010

1111
> `yarn add -s @bucketco/node-sdk` or `npm install -s @bucketco/node-sdk`.
1212
13-
Other supported languages/frameworks are in the
14-
[Supported languages](https://docs.bucket.co/quickstart/supported-languages)
15-
documentation pages.
13+
Other supported languages/frameworks are in the [Supported languages](https://docs.bucket.co/quickstart/supported-languages) documentation pages.
1614

17-
You can also [use the HTTP API directly](https://docs.bucket.co/reference/http-tracking-api)
15+
You can also [use the HTTP API directly](https://docs.bucket.co/api/http-api)
1816

1917
## Basic usage
2018

21-
To get started you need to obtain your secret key from the
22-
[environment settings](https://app.bucket.co/envs/current/settings/app-environments)
19+
To get started you need to obtain your secret key from the [environment settings](https://app.bucket.co/envs/current/settings/app-environments)
2320
in Bucket.
2421

2522
> [!CAUTION]
@@ -138,8 +135,8 @@ await client.flush();
138135
139136
### Rate Limiting
140137

141-
The SDK includes automatic rate limiting for feature events to prevent overwhelming the API. Rate limiting is applied per
142-
unique combination of feature key and context. The rate limiter window size is configurable:
138+
The SDK includes automatic rate limiting for feature events to prevent overwhelming the API.
139+
Rate limiting is applied per unique combination of feature key and context. The rate limiter window size is configurable:
143140

144141
```typescript
145142
const client = new BucketClient({

packages/node-sdk/src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export function hashObject(obj: Record<string, any>): string {
160160
const hash = createHash("sha1");
161161
updateSha1Hash(hash, obj);
162162

163-
return hash.digest("hex");
163+
return hash.digest("base64");
164164
}
165165

166166
export function once<T extends () => ReturnType<T>>(

packages/node-sdk/test/client.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,9 +1598,7 @@ describe("BucketClient", () => {
15981598
await client.initialize();
15991599
client.getFeatures({ user, company, other: otherContext });
16001600

1601-
expect(isAllowedSpy).toHaveBeenCalledWith(
1602-
"d461e93fe41f6297ab43402d0fc6d63e2444e07d",
1603-
);
1601+
expect(isAllowedSpy).toHaveBeenCalledWith("1GHpP+QfYperQ0AtD8bWPiRE4H0=");
16041602
});
16051603

16061604
it("should return evaluated features when only user is defined", async () => {

packages/node-sdk/test/utils.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe("hashObject", () => {
167167
expectedHash.update("name");
168168
expectedHash.update("Alice");
169169

170-
expect(hash).toBe(expectedHash.digest("hex"));
170+
expect(hash).toBe(expectedHash.digest("base64"));
171171
});
172172

173173
it("should hash arrays within objects", () => {
@@ -180,7 +180,7 @@ describe("hashObject", () => {
180180
expectedHash.update("2");
181181
expectedHash.update("3");
182182

183-
expect(hash).toBe(expectedHash.digest("hex"));
183+
expect(hash).toBe(expectedHash.digest("base64"));
184184
});
185185
});
186186

yarn.lock

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ __metadata:
6969
languageName: node
7070
linkType: hard
7171

72+
"@babel/code-frame@npm:^7.26.2":
73+
version: 7.26.2
74+
resolution: "@babel/code-frame@npm:7.26.2"
75+
dependencies:
76+
"@babel/helper-validator-identifier": "npm:^7.25.9"
77+
js-tokens: "npm:^4.0.0"
78+
picocolors: "npm:^1.0.0"
79+
checksum: 10c0/7d79621a6849183c415486af99b1a20b84737e8c11cd55b6544f688c51ce1fd710e6d869c3dd21232023da272a79b91efb3e83b5bc2dc65c1187c5fcd1b72ea8
80+
languageName: node
81+
linkType: hard
82+
7283
"@babel/compat-data@npm:^7.24.7":
7384
version: 7.24.7
7485
resolution: "@babel/compat-data@npm:7.24.7"
@@ -260,12 +271,12 @@ __metadata:
260271
linkType: hard
261272

262273
"@babel/helpers@npm:^7.24.7":
263-
version: 7.24.7
264-
resolution: "@babel/helpers@npm:7.24.7"
274+
version: 7.26.10
275+
resolution: "@babel/helpers@npm:7.26.10"
265276
dependencies:
266-
"@babel/template": "npm:^7.24.7"
267-
"@babel/types": "npm:^7.24.7"
268-
checksum: 10c0/aa8e230f6668773e17e141dbcab63e935c514b4b0bf1fed04d2eaefda17df68e16b61a56573f7f1d4d1e605ce6cc162b5f7e9fdf159fde1fd9b77c920ae47d27
277+
"@babel/template": "npm:^7.26.9"
278+
"@babel/types": "npm:^7.26.10"
279+
checksum: 10c0/f99e1836bcffce96db43158518bb4a24cf266820021f6461092a776cba2dc01d9fc8b1b90979d7643c5c2ab7facc438149064463a52dd528b21c6ab32509784f
269280
languageName: node
270281
linkType: hard
271282

@@ -333,12 +344,23 @@ __metadata:
333344
languageName: node
334345
linkType: hard
335346

347+
"@babel/parser@npm:^7.26.9":
348+
version: 7.26.10
349+
resolution: "@babel/parser@npm:7.26.10"
350+
dependencies:
351+
"@babel/types": "npm:^7.26.10"
352+
bin:
353+
parser: ./bin/babel-parser.js
354+
checksum: 10c0/c47f5c0f63cd12a663e9dc94a635f9efbb5059d98086a92286d7764357c66bceba18ccbe79333e01e9be3bfb8caba34b3aaebfd8e62c3d5921c8cf907267be75
355+
languageName: node
356+
linkType: hard
357+
336358
"@babel/runtime@npm:^7.12.5":
337-
version: 7.24.6
338-
resolution: "@babel/runtime@npm:7.24.6"
359+
version: 7.26.10
360+
resolution: "@babel/runtime@npm:7.26.10"
339361
dependencies:
340362
regenerator-runtime: "npm:^0.14.0"
341-
checksum: 10c0/224ad205de33ea28979baaec89eea4c4d4e9482000dd87d15b97859365511cdd4d06517712504024f5d33a5fb9412f9b91c96f1d923974adf9359e1575cde049
363+
checksum: 10c0/6dc6d88c7908f505c4f7770fb4677dfa61f68f659b943c2be1f2a99cb6680343462867abf2d49822adc435932919b36c77ac60125793e719ea8745f2073d3745
342364
languageName: node
343365
linkType: hard
344366

@@ -353,6 +375,17 @@ __metadata:
353375
languageName: node
354376
linkType: hard
355377

378+
"@babel/template@npm:^7.26.9":
379+
version: 7.26.9
380+
resolution: "@babel/template@npm:7.26.9"
381+
dependencies:
382+
"@babel/code-frame": "npm:^7.26.2"
383+
"@babel/parser": "npm:^7.26.9"
384+
"@babel/types": "npm:^7.26.9"
385+
checksum: 10c0/019b1c4129cc01ad63e17529089c2c559c74709d225f595eee017af227fee11ae8a97a6ab19ae6768b8aa22d8d75dcb60a00b28f52e9fa78140672d928bc1ae9
386+
languageName: node
387+
linkType: hard
388+
356389
"@babel/traverse@npm:^7.24.7":
357390
version: 7.24.7
358391
resolution: "@babel/traverse@npm:7.24.7"
@@ -392,6 +425,16 @@ __metadata:
392425
languageName: node
393426
linkType: hard
394427

428+
"@babel/types@npm:^7.26.10":
429+
version: 7.26.10
430+
resolution: "@babel/types@npm:7.26.10"
431+
dependencies:
432+
"@babel/helper-string-parser": "npm:^7.25.9"
433+
"@babel/helper-validator-identifier": "npm:^7.25.9"
434+
checksum: 10c0/7a7f83f568bfc3dfabfaf9ae3a97ab5c061726c0afa7dcd94226d4f84a81559da368ed79671e3a8039d16f12476cf110381a377ebdea07587925f69628200dac
435+
languageName: node
436+
linkType: hard
437+
395438
"@babel/types@npm:^7.8.3":
396439
version: 7.24.5
397440
resolution: "@babel/types@npm:7.24.5"
@@ -5436,13 +5479,13 @@ __metadata:
54365479
linkType: hard
54375480

54385481
"axios@npm:^1.6.0":
5439-
version: 1.7.4
5440-
resolution: "axios@npm:1.7.4"
5482+
version: 1.8.4
5483+
resolution: "axios@npm:1.8.4"
54415484
dependencies:
54425485
follow-redirects: "npm:^1.15.6"
54435486
form-data: "npm:^4.0.0"
54445487
proxy-from-env: "npm:^1.1.0"
5445-
checksum: 10c0/5ea1a93140ca1d49db25ef8e1bd8cfc59da6f9220159a944168860ad15a2743ea21c5df2967795acb15cbe81362f5b157fdebbea39d53117ca27658bab9f7f17
5488+
checksum: 10c0/450993c2ba975ffccaf0d480b68839a3b2435a5469a71fa2fb0b8a55cdb2c2ae47e609360b9c1e2b2534b73dfd69e2733a1cf9f8215bee0bcd729b72f801b0ce
54465489
languageName: node
54475490
linkType: hard
54485491

0 commit comments

Comments
 (0)