@scaleway/use-growthbook
Version:
Utility package to expose AB test tool
14 lines (13 loc) • 499 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const growthbookReact = require("@growthbook/growthbook-react");
const useAbTestAttributes = () => {
const growthBook = growthbookReact.useGrowthBook();
const attributes = growthBook.getAttributes();
const setAttributes = (newAttributes) => growthBook.setAttributes({
...attributes,
...newAttributes
});
return [attributes, setAttributes];
};
exports.useAbTestAttributes = useAbTestAttributes;