1.0.5 • Published 1 month ago

decisionlab v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
1 month ago

DecisionLab

Ship changes to production immediately. No need to wait for engineers, pull-requests, or code freezes.

Install decision lab in your React app

Install with

npm i decisionlab

Get your client key at https://app.justdecision.com/account

https://app.justdecision.com/account

You can find your key over there

Configure your app

Add it as a wrapper of your application, ideally as high as you can.

You can either save your DecisionLab key as an environment variable or as any constant, and provide it to your app via the clientKey prop on the DecisionProvider component.

import { DecisionProvider } from "decisionlab";

const DECISION_LAB_CLIENT_KEY = "your_application_key"

...

const App = () => {
  return (
    <DecisionProvider clientKey={DECISION_LAB_CLIENT_KEY}>
      <MyAppProviders>Your app goes here</MyAppProviders>
    </DecisionProvider>
  );
};

Use decisions using the useDecision React hook

import { useDecision } from "decisionlab";

const MyComponent = () => {
  const value = useDecision("my_first_decision");
  return <div>My value is: {value}</div>;
};
1.0.5

1 month ago

1.0.4

1 month ago

1.0.2

5 months ago

1.0.3

5 months ago

1.0.1

1 year ago

1.0.0

1 year ago