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.
yarn install https://github.com/wings-software/js-client-sdk
Import installed library:
import * as CF from "js-client-sdk";
Initialize SDK with api key and target
const cf = CF.initialize("2c2a12a1-6599-406e-96c4-031a51c8a51b", "replace with your target", {
streamEnabled: true,
});
and customize it with configuration options:
export const defaultConfiguration: Options = {
baseUrl: 'http://localhost:3000/api/1.0',
streamEnabled: false,
allAttributesPrivate: false,
privateAttributeNames: [],
};
attach on connect listener:
cf.on("connected", () => {
setConnected(true); // your custom function
});
attach on disconnect listener:
cf.on("disconnected", () => {
setConnected(false); // your custom function
});
attach on reconnect listener:
cf.on("reconnected", () => {
setConnected(true); // your custom function
});
attach on update listener:
cf.eventBus.on("changed", ({detail}) => {
setFlag(detail); // your custom function
})
attach on error listener:
cf.eventBus.on("error", ({detail}) => {
setFlag(detail); // your custom function
})
or evaluate flag with concrete function call:
const value = await cf.variation("bool-flag2", false);
OR
cf.variation("bool-flag2", false).then(value => {
// ...
})
on closing your application always close the client:
cf.close();
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.