Skip to content

Commit 38750ac

Browse files
authored
Merge branch 'main' into node-sdk-feature-definitions
2 parents 087c4c8 + ede2549 commit 38750ac

File tree

4 files changed

+9
-14
lines changed

4 files changed

+9
-14
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
@@ -1596,9 +1596,7 @@ describe("BucketClient", () => {
15961596
await client.initialize();
15971597
client.getFeatures({ user, company, other: otherContext });
15981598

1599-
expect(isAllowedSpy).toHaveBeenCalledWith(
1600-
"d461e93fe41f6297ab43402d0fc6d63e2444e07d",
1601-
);
1599+
expect(isAllowedSpy).toHaveBeenCalledWith("1GHpP+QfYperQ0AtD8bWPiRE4H0=");
16021600
});
16031601

16041602
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

0 commit comments

Comments
 (0)