clvision
v1.0.0
Published
Customer Lifetime Value tracking and analytics library for CLVision
Maintainers
Readme
CLVision
CLVision tracking script for pageviews, signin and signups.
Installation
USAGE
npm install clvision
import { initialize } from 'clvision';
const clvision = initialize({ organizationId: 'your-org-id', // As provided by CLVision baseURL: 'https://your-api-url' // Optional });
// Track events
// Pageviews are tracked autonomously so long as the script is initialized in the root of your app as follows
import CLVision from "clvision";
const clvision = new CLVision({ organizationId: "your-org-id", // as provided by CLVision baseURL: "https://clvision.app/api/tracking", // optional });
// Send event on user sign up, run this on your auth signup callback clvision.trackSignup('[email protected]');
// Send event on user sign in, run this on your auth signin callback clvision.trackSignin('[email protected]');
// Example usage with different auth providers
// With Google onGoogleSignIn((response) => { const email = response.email; const isNewUser = response.isNewUser; if (isNewUser) { clvision.trackSignup(email, 'google'); } else { clvision.trackSignin(email, 'google'); } });
// With Email/Password onEmailSignup((email) => { clvision.trackSignup(email, 'email'); });