New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@featurevisor/sdk

Package Overview
Dependencies
Maintainers
1
Versions
114
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@featurevisor/sdk

Featurevisor SDK for Node.js and the browser

  • 0.5.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

@featurevisor/sdk

Universal Featurevisor SDK for both Node.js and the browser.

Visit https://featurevisor.com for more information.

Installation

$ npm install --save @featurevisor/sdk

Usage

Initialize the SDK:

import { createInstance } from "@featurevisor/sdk";

const datafileContent = fetch(datafileURL).then((res) => res.json());

const sdk = createInstance({
  // required
  datafile: datafileContent,

 // optional
 onActivation: (featureKey, variant, attributes, captureAttributes) => {
   console.log(`Feature ${featureKey} activated with variant ${variant}`);
 },
});

API

getVariation

getVariation(featureKey: string, attributes: Attributes): VariationValue

getVariable

getVariable(featureKey: string, variableKey: string, attributes: Attributes): VariableValue

activate

activate(featureKey: string, attributes: Attributes): VariationValue

Same as getVariation, but also calls the onActivation callback.

This is a convenience method meant to be called when you know the User has been exposed to your Feature, and you also want to track the activation.

License

MIT © Fahad Heylaal

Keywords

FAQs

Package last updated on 25 Mar 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc