
Security News
GitHub Actions Supply Chain Attack Puts Thousands of Projects at Risk
A compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
@openfeature/flagd-provider
Advanced tools
Flagd is a simple daemon for evaluating feature flags. It is designed to conform to OpenFeature schema for flag definitions. This repository and package provides the client code for interacting with it via the OpenFeature server-side JavaScript SDK.
Flagd is a simple daemon for evaluating feature flags. It is designed to conform to OpenFeature schema for flag definitions. This repository and package provides the client code for interacting with it via the OpenFeature server-side JavaScript SDK.
$ npm install @openfeature/flagd-provider
Required peer dependencies
$ npm install @openfeature/js-sdk
The FlagdProvider
supports multiple configuration options that determine now the SDK communicates with flagd.
Options can be defined in the constructor or as environment variables, with constructor options having the highest precedence.
Option name | Environment variable name | Type | Default | Values |
---|---|---|---|---|
host | FLAGD_HOST | string | localhost | |
port | FLAGD_PORT | number | 8013 | |
tls | FLAGD_TLS | boolean | false | |
socketPath | FLAGD_SOCKET_PATH | string | - | |
cache | FLAGD_CACHE | string | lru | lru,disabled |
maxCacheSize | FLAGD_MAX_CACHE_SIZE | int | 1000 | |
maxEventStreamRetries | FLAGD_MAX_EVENT_STREAM_RETRIES | int | 5 |
OpenFeature.setProvider(new FlagdProvider({
host: 'localhost',
port: 8013,
}))
OpenFeature.setProvider(new FlagdProvider({
socketPath: "/tmp/flagd.socks",
}))
The flagd provider emits PROVIDER_READY
, PROVIDER_ERROR
and PROVIDER_CONFIGURATION_CHANGED
events.
SDK event | Originating action in flagd |
---|---|
PROVIDER_READY | The streaming connection with flagd has been established. |
PROVIDER_ERROR | The streaming connection with flagd has been broken. |
PROVIDER_CONFIGURATION_CHANGED | A flag configuration (default value, targeting rule, etc) in flagd has changed. |
For general information on events, see the official documentation.
Field | Type | Value |
---|---|---|
scope | string | "selector" set for the associated source in flagd |
Run nx package providers-flagd
to build the library.
NOTE: Buf must be installed to build locally.
Run nx test providers-flagd
to execute the unit tests via Jest.
FAQs
This provider is designed to use flagd's [evaluation protocol](https://github.com/open-feature/schemas/blob/main/protobuf/schema/v1/schema.proto), or locally evaluate flags defined in a flagd [flag definition](https://github.com/open-feature/schemas/blob/
We found that @openfeature/flagd-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.
Security News
A compromised GitHub Action exposed secrets in CI/CD logs, putting thousands of projects at risk and forcing developers to urgently secure their workflows.
Research
Security News
A malicious Maven package typosquatting a popular library is secretly stealing OAuth credentials on the 15th of each month, putting Java developers at risk.
Security News
Socket and Seal Security collaborate to fix a critical npm overrides bug, resolving a three-year security issue in the JavaScript ecosystem's most popular package manager.