Declarative analytics logging library for React
See Docs.
Gavis - A declarative analytics logging library for React
Writing code for analytics logging is so boring and stressful. I wanted not to spend much time on writing codes related to logging but to focus on the application itself.
Gavis is an analytics logging library which helps you ..
- Send logs in declarative ways
- Get data needed for logging with less code
- Prevent sending duplicate logs for a single event
- Testing easily
// without Gavis
const Page = () => {
useEffect(() => {
sendLog({ category: "Post", action: "view" });
}, [sendLog]);
return <div>Hello World</div>;
};
Can be rewritten using Gavis :
// with Gavis
const Page = () => {
return (
<Gavis category="Post" action="view" logOnMount>
<div>Hello World</div>
</Gavis>
);
};
yarn add gavis
You can test Gavis with jest
or in the playground application.
yarn test
yarn playground