@hackler/js-client-sdk
TypeScript icon, indicating that this package has built-in type declarations

3.5.0 • Public • Published

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);
});

Readme

Keywords

Package Sidebar

Install

npm i @hackler/js-client-sdk

Weekly Downloads

42

Version

3.5.0

License

ISC

Unpacked Size

2.72 MB

Total Files

35

Last publish

Collaborators

  • hackler