Node.js SDK
What is the Node.js SDK?
The Node.js SDK is an open-source server-side Typescript/JavaScript library that allows you to integrate Bucket with your app.
See our OpenFeature Node.js Provider for integration with OpenFeature.
Getting started
You can find the full developer documentation on GitHub.
Install the SDK
Install the SDK using yarn
or npm
.
Basic usage
Get started by getting a secret key from the Environment settings in Bucket.
Secret keys are meant for use in server-side SDKs only.
Secret keys allow users to obtain sensitive information. They should not be used in client-side applications.
Once the client is initialized, one can obtain features along with the isEnabled
status to indicate whether the feature is targeted for this user/company and the track
function to let you track feature usage:
When you bind a client to a user/company
, the data is matched against the targeting rules.
To get accurate targeting, you must ensure that the provided user/company
information is sufficient to match the targeting rules you've created.
The user/company
data is automatically transferred to Bucket, ensuring up-to-date user/company
information and accurate targeting.
High-performance feature targeting
The SDK contacts Bucket servers when you call initialize
and downloads the features with their targeting rules.
These rules are then matched against the provided user/company
information to getFeatures
(or through bindClient(..).getFeatures()
).
The getFeatures
call doesn't need to contact Bucket servers once initialize
has been completed.
BucketClient
will periodically download targeting rules from the Bucket servers in the background.
Complete developer documentation
There's much more you can do with the Bucket Node.js SDK. See the full developer documentation on Github.
Last updated