livetrack-react
v1.0.8
Published
A React client package for tracking online users
Downloads
15
Maintainers
Readme
LiveTrack React
This package allows you to track live users on your website and display them using a widget.
Installation
npm install livetrack-react
Getting Started
- Go to Live Track JS to create an account and get your API key.
Usage
To integrate the live tracking widget into your React app:
- Wrap your app with the
LiveTrackProvider
and include the css file andLiveUsersWidget
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...
);
}
- You can track the activities on your sites through the dashboard
Features
- Real-time User Tracking: Instantly see how many users are active on your site.
- Simple Integration: Add the widget with just a few lines of code.
- Customizable: Modify thw widget to your design.
Github
- Go to Live Track JS to know more.