Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@harnessio/ff-javascript-client-sdk
Advanced tools
Basic library for integrating CF into javascript applications.
Basic library for integrating CF into javascript applications.
npm i @harnessio/ff-javascript-client-sdk
or
yarn add @harnessio/ff-javascript-client-sdk
import { initialize, Event } from '@harnessio/ff-javascript-client-sdk'
Initialize SDK with api key and target information.
// Replace with your SDK Key
const FF_SDK_KEY = "2c2a12a1-6599-406e-96c4-031a51c8a51b"
const cf = initialize(FF_SDK_KEY, {
identifier: YOUR-TARGET-IDENTIFIER, // Target identifier
name: YOUR-TARGET-NAME, // Optional target name
attributes: { // Optional target attributes
email: 'sample@sample.com'
}
}, {
baseUrl: 'http://40.20.100.200/api/1.0', // Replace with your Feature Flags server
});
cf
instance.cf.on(Event.READY, flags => {
// Event happens when connection to server is established
// flags contains all evaluations against SDK key
})
cf.on(Event.CHANGED, flagInfo => {
// Event happens when a changed event is pushed
// flagInfo contains information about the updated feature flag
})
cf.on(Event.DISCONNECTED, () => {
// Event happens when connection is disconnected
})
cf.on(Event.ERROR, () => {
// Event happens when connection some error has occurred
})
const value = cf.variation("dark-theme", false)
Remove a listener of an event by cf.off
.
cf.off(Event.ERROR, YOUR-CLOSURE)
Remove all listeners:
cf.off()
On closing your application, call cf.close()
to close the stream.
cf.close();
Apache version 2.
FAQs
Basic library for integrating CF into javascript applications.
The npm package @harnessio/ff-javascript-client-sdk receives a total of 12,246 weekly downloads. As such, @harnessio/ff-javascript-client-sdk popularity was classified as popular.
We found that @harnessio/ff-javascript-client-sdk 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.