
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@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);
// use more complex, dynamic config-enabled functionality.
const feedbackConfig = client.getObjectValue("ask-feedback", {
question: "How are you enjoying this feature?",
});
Initializing the Bucket Browser Provider will also initialize automatic feedback surveys.
The Bucket OpenFeature Provider implements the OpenFeature evaluation interface for different value types. Each method handles the resolution of feature flags according to the OpenFeature specification.
All resolution methods share these behaviors:
PROVIDER_NOT_READY
if client is not initialized,FLAG_NOT_FOUND
if flag doesn't exist,ERROR
if there was a type mismatch,TARGETING_MATCH
on successful resolution.client.getBooleanValue("my-flag", false);
Returns the feature's enabled state. This is the most common use case for feature flags.
client.getStringValue("my-flag", "default");
Returns the feature's remote config key (also known as "variant"). Useful for multi-variate use cases.
client.getNumberValue("my-flag", 0);
Not directly supported by Bucket. Use getObjectValue
instead for numeric configurations.
// works for any type:
client.getObjectValue("my-flag", { defaultValue: true });
client.getObjectValue("my-flag", "string-value");
client.getObjectValue("my-flag", 199);
Returns the feature's remote config payload with type validation. This is the most flexible method, allowing for complex configuration objects or simple types.
The object resolution performs runtime type checking between the default value and the feature payload to ensure type safety.
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>";
// this converts the context to a Bucket compatible context
// adapt it to fit your need
const contextTranslator = (context?: EvaluationContext) => {
return {
user: {
id: context.targetingKey ?? context["userId"],
email: context["email"]?.toString(),
name: context["name"]?.toString(),
avatar: context["avatar"]?.toString(),
country: context["country"]?.toString(),
},
company: {
id: context["companyId"],
name: context["companyName"]?.toString(),
avatar: context["companyAvatar"]?.toString(),
plan: context["companyPlan"]?.toString(),
},
};
};
const bucketOpenFeatureProvider = new BucketBrowserProvider({
publishableKey,
contextTranslator,
});
To update the context, call OpenFeature.setContext(myNewContext);
await OpenFeature.setContext({ userId: "my-key" });
The Bucket OpenFeature Provider supports the OpenFeature tracking API natively.
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 OpenFeature provider and get client
await OpenFeature.setProviderAndWait(bucketProvider);
const client = OpenFeature.getClient();
// use client to send an event when user uses a feature
client.track("huddles");
MIT License Copyright (c) 2025 Bucket ApS
FAQs
The official OpenFeature Browser provider for [Bucket](https://bucket.co) feature management service.
The npm package @bucketco/openfeature-browser-provider receives a total of 11 weekly downloads. As such, @bucketco/openfeature-browser-provider popularity was classified as not popular.
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 4 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.