@vutolabs/analytics
v0.0.0-alpha.4
Published
Vuto Analytics - instant, Stripe-native analytics for SaaS apps built with Next.js or React.
Maintainers
Readme
@vuto/analytics
Vuto Web Analytics — simple, Stripe-native analytics for modern SaaS apps.
Track visits, signups, and payments without complex setup.
🚀 Features
- 📈 Auto pageview tracking (with UTM, referrer)
- 🧑💻 Identify users with
email - 💳 Stripe-native: link MRR, payments, churn
- ⚡️ Lightweight, privacy-first
- 🧩 Works with Next.js, React, and any SPA
🛠 Installation
$ npm install @vutolabs/analytics
$ yarn add @vutolabs/analytics
$ pnpm add @vutolabs/analytics📦 Usage
In Next.js (App Router)
// app/layout.tsx
import { Analytics } from "@vutolabs/analytics/next";
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Analytics projectId="YOUR_PROJECT_ID" />
</body>
</html>
);
}In React (SPA)
import { Analytics } from "@vutolabs/analytics/react";
function App() {
return <Analytics projectId="YOUR_PROJECT_ID" />;
}🧠 Tracking custom events
import { track } from "@vutolabs/analytics";
track("Signup", {
plan: "Pro",
ref: "LaunchWeek",
});👤 Identifying users
Next.js
// useVutoIdentify.ts
import { useEffect } from "react";
import { IUser } from "../interfaces/user.interface";
import { identify } from "@vutolabs/analytics";
export function useVutoIdentify(user: IUser | null) {
useEffect(() => {
if (!user) return;
const key = `identified:${user.email}`;
const alreadyIdentified = sessionStorage.getItem(key);
if (!alreadyIdentified) {
identify(user.email);
sessionStorage.setItem(key, "true");
}
}, [user]);
}Add the hook in your Auth hook when the user is logged in.
📚 Documentation
Full docs coming soon. Stay tuned at vuto.dev
�� License
MPL-2.0
