A React client package for tracking online users
This package allows you to track live users on your website and display them using a widget.
npm install livetrack-react
To integrate the live tracking widget into your React app:
LiveTrackProvider
and include the css file and LiveUsersWidget
component:import { LiveTrackProvider, LiveUsersWidget } from "livetrack-react";
import "livetrack-react/style.css";
function App() {
return (
<LiveTrackProvider apiKey="your-api-key">
<LiveUsersWidget />
</LiveTrackProvider>
);
}
export default App;
Replace "your-api-key"
with the API key provided in dashboard.
Now, when users visit your website, they will be able to see live user activity displayed via the LiveUsersWidget
component.
You can also use the "useLiveUsers" hook to make a customizable widget of your choice.
import { useLiveUsers } from "livetrack-react";
export const widget =()=> {
return (
const {liveUsers, isLoading, error} = useLiveUsers();
//your custom widget goes here...
);
}