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

11.45.2 • Public • Published

Hackle React SDK

Install

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

Usage

initialize

import { createInstance, HackleProvider } from "@hackler/react-sdk";

const hackleClient = createInstance("YOUR_SDK_KEY")
const user = {
  id: "ae2182e0", 
  properties: {
    app_version: "1.0.1",
    age: 23,
    paying_customer: true
  } 
}
ReactDOM.render(
  <HackleProvider hackleClient={hackleClient} user={user} timeout={1000}>
    <YourApp />
  </HackleProvider>,
  document.getElementById('root')
);

Decide the variation

function App() {
  return (
    <HackleExperiment experimentKey={42}>
      <HackleVariation variation={"A"}>
        <OldBlueButton />
      </HackleVariation>
      <HackleVariation variation={"B"}>
        <NewRedButton />
      </HackleVariation>
    </HackleExperiment>
  )
}

Records the event

const track = useTrack()
const event = {
  key: "purchase",
  value: 5000,
  properties: {
    first_paying: false,
    item_count: 5
  }
}

<button onClick={() => track(event)}>Purchase</button>

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.0.0-rc.20rc
11.13.30patch-11.13.3
11.45.2277latest

Version History

VersionDownloads (Last 7 Days)Published
11.45.2277
11.45.1230
11.45.02
11.44.070
11.43.0128
11.42.00
11.41.011
11.40.04
11.39.064
11.38.123
11.38.04
11.37.1207
11.37.020
11.36.081
11.35.032
11.34.21
11.34.124
11.33.17
11.33.02
11.32.144
11.32.00
11.31.20
11.31.10
11.31.00
11.30.094
11.29.10
11.29.00
11.28.10
11.28.00
11.27.20
11.27.10
11.27.01
11.26.20
11.26.10
11.26.00
11.25.254
11.25.10
11.25.00
11.24.21
11.24.10
11.24.00
11.23.00
11.22.3147
11.22.20
11.22.10
11.22.00
11.21.00
11.20.00
11.19.00
11.18.10
11.18.00
11.17.028
11.16.30
11.16.222
11.15.30
11.16.10
11.16.00
11.15.20
11.15.10
11.14.413
11.13.30
11.14.30
11.14.20
11.13.20
11.12.10
11.14.10
11.13.10
11.14.00
11.13.00
11.12.021
11.11.014
11.10.20
11.10.10
11.10.00
11.9.10
11.9.00
11.8.00
11.7.31
11.7.10
11.7.00
11.6.00
11.5.10
11.5.00
11.4.00
11.3.10
11.2.10
11.3.00
11.2.00
11.1.00
11.0.10
11.0.00
3.5.05
3.4.40
3.4.31
3.4.20
3.4.10
3.4.00
3.3.30
3.3.20
3.3.10
3.2.10
3.1.20
3.0.31
3.3.00
3.2.00
3.1.10
3.1.00
3.0.20
3.0.10
2.2.40
2.1.10
3.0.00
2.2.30
2.2.20
2.2.10
2.2.00
2.1.00
2.0.00
2.0.0-rc.20
2.0.0-rc.10
1.2.00
1.2.0-rc.110
1.2.0-rc.100
1.2.0-rc.90
1.2.0-rc.81
1.2.0-rc.70
1.2.0-rc.60
1.2.0-rc.50
1.2.0-rc.41
1.2.0-rc.30
1.2.0-rc.20
1.2.0-rc.10
1.2.0-rc.00
1.1.20
1.1.11
1.1.00
1.1.0-rc.40
1.1.0-rc.30
1.1.0-rc.21
1.1.0-rc.10
1.0.60
1.0.50
1.0.40
1.0.30
1.0.10

Package Sidebar

Install

npm i @hackler/react-sdk

Weekly Downloads

1,394

Version

11.45.2

License

ISC

Unpacked Size

413 kB

Total Files

30

Last publish

Collaborators

  • hackler