Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@bucketco/openfeature-browser-provider
Advanced tools
The official OpenFeature Browser provider for [Bucket](https://bucket.co) feature management service.
The official OpenFeature Browser provider for Bucket feature management service.
It uses the Bucket Browser SDK internally and thus allow you to collect automated feedback surveys when people use your features as well as tracking which customers use which features.
If you're using React, you'll be better off with the Bucket React SDK or the OpenFeature React SDK.
See the example
folder for how to use the OpenFeature React SDK with Next.js.
The OpenFeature SDK is required as peer dependency.
The minimum required version of @openfeature/web-sdk
currently is 1.0
.
$ npm install @openfeature/web-sdk @bucketco/openfeature-browser-provider
import { BucketBrowserProvider } from "@bucketco/openfeature-browser-provider";
import { OpenFeature } from "@openfeature/web-sdk";
// initialize provider
const publishableKey = "<your-bucket-publishable-key>";
const bucketProvider = new BucketBrowserProvider({ publishableKey });
// set open feature provider and get client
await OpenFeature.setProviderAndWait(bucketProvider);
const client = OpenFeature.getClient();
// use client
const boolValue = client.getBooleanValue("huddles", false);
Bucket only supports boolean values.
Initializing the Bucket Browser Provider will also initialize automatic feedback surveys.
To convert the OpenFeature context to a Bucket appropriate context
pass a translation function along to the BucketBrowserProvider
constructor
like so:
import { BucketBrowserProvider } from "@bucketco/openfeature-browser-provider";
import { EvaluationContext, OpenFeature } from "@openfeature/web-sdk";
// initialize provider
const publishableKey = "<your-bucket-publishable-key>";
const contextTranslator = (context?: EvaluationContext) => {
return {
user: { id: context.userId, name: context.name, email: context.email },
company: { id: context.orgId, name: context.orgName },
};
};
const bucketOpenFeatureProvider = new BucketBrowserProvider({
publishableKey,
contextTranslator,
});
To update the context, call OpenFeature.setContext(myNewContext);
await OpenFeature.setContext({ userId: "my-key" });
To track feature usage, use the track
method on the client.
By default you can use the flag/feature key as the event name
as the first argument to designate feature usage when calling
the track
method:
import { EvaluationContext, OpenFeature } from "@openfeature/web-sdk";
import { BucketBrowserProvider } from "@bucketco/openfeature-browser-provider";
const bucketOpenFeatureProvider = new BucketBrowserProvider({
publishableKey,
});
bucketOpenFeatureProvider.client.track("huddle", { voiceHuddle: true });
MIT License
Copyright (c) 2024 Bucket ApS
FAQs
The official OpenFeature Browser provider for [Bucket](https://bucket.co) feature management service.
We found that @bucketco/openfeature-browser-provider demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.