Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions packages/node-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,25 @@ const client = new BucketClient({
});
```

### Caching
### Feature definitions

Feature definitions are automatically cached and refreshed in the background. The cache behavior is configurable:
Feature definitions include the rules needed to determine which features should be enabled and which config values should be applied to any given user/company.
Feature definitions are automatically fetched when calling `initialize()`.
They are then cached and refreshed in the background.
It's also possible to get the currently in use feature definitions:

```typescript
const client = new BucketClient({
refetchInterval: 30000, // How often to refresh features (ms)
staleWarningInterval: 150000, // When to warn about stale features (ms)
});
import fs from "fs";

const client = new BucketClient();

const featureDefs = await client.getFeatureDefinitions();
// [{
// key: "huddle",
// description: "Live voice conversations with colleagues."
// flag: { ... }
// config: { ... }
// }]
```

## Error Handling
Expand Down Expand Up @@ -197,12 +207,12 @@ fallback behavior:
4. **Offline Mode**:

```typescript
// In offline mode, the SDK uses fallback features
// In offline mode, the SDK uses feature overrides
const client = new BucketClient({
offline: true,
fallbackFeatures: {
featureOverrides: () => ({
"my-feature": true,
},
}),
});
```

Expand Down
2 changes: 1 addition & 1 deletion packages/node-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bucketco/node-sdk",
"version": "1.7.0",
"version": "1.8.0",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
Loading