React
React (Vite, CRA, Remix client) + @millimetric/track.
Install
npm i @millimetric/trackInit at the root
// src/main.tsx (Vite)
import { StrictMode, useEffect } from "react";
import { createRoot } from "react-dom/client";
import { init } from "@millimetric/track";
import App from "./App";
function Analytics({ children }: { children: React.ReactNode }) {
useEffect(() => {
init({
key: import.meta.env.VITE_AOA_KEY!,
host: import.meta.env.VITE_AOA_HOST ?? "https://api.millimetric.ai"
});
}, []);
return <>{children}</>;
}
createRoot(document.getElementById("root")!).render(
<StrictMode>
<Analytics>
<App />
</Analytics>
</StrictMode>
);Identify on login
Track on intent
A tiny custom hook (optional)
React Router — manual page() if you turn off auto
React Server Components / SSR
Tracking errors / boundaries
Last updated
Was this helpful?