🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@hackler/js-client-sdk

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hackler/js-client-sdk

JavaScript Client(Web Browser) SDK

3.5.0
latest
Version published
Weekly downloads
23
91.67%
Maintainers
1
Weekly downloads
 
Created

Hackle JavaScript Client(Web Browser) SDK

Install

npm install @hackler/js-client-sdk --save

Usage

Install & Decide the variation

const Hackle = require("@hackler/hackle-sdk");

const hackleClient = Hackle.createInstance("YOUR_SDK_KEY");

hackleClient.onReady(() => {
    const variation = hackleClient.variation(AB_TEST_KEY);
   
    if (variation === "A") {
      // AS-IS Code
    } else if (variation === "B") {
      // TO-BE Code
    }
})

Records the event

hackleClient.onReady(() => {
  hackleClient.track(EVENT_KEY);
});

FAQs

Package last updated on 11 Aug 2022

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