Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@hackler/javascript-sdk

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hackler/javascript-sdk

JavaScript SDK For Hackle

  • 11.15.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.5K
decreased by-32.8%
Maintainers
1
Weekly downloads
 
Created
Source

Hackle JavaScript SDK

Install

npm install @hackler/javascript-sdk --save
yarn add @hackler/javascript-sdk

Usage

Install & Decide the variation

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

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

http.createServer((req, res) => {
    const user = {
      id: USER_ID
    }   
    const variation = hackleClient.variation(AB_TEST_KEY, user);
    
    if (variation === "A") {
      // AS-IS Code
    } else if (variation === "B") {
      // TO-BE Code
    }

    res.end(`Hello ${variation}!`)
}).listen(8080)

Records the event

hackleClient.track(EVENT_KEY, user);

or

const event = {
  key: EVENT_KEY,
  value: 5000,
  properties: {
    app_version: "1.0.0",
    first_paying: false,
    item_count: 5
  }
}
hackleClient.track(event, user);

Keywords

FAQs

Package last updated on 16 May 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