LiveTrackJS

A React client package for tracking online users

Downloads
341
Stars
0

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

  1. 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:

  1. Wrap your app with the 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.

  1. Now, when users visit your website, they will be able to see live user activity displayed via the LiveUsersWidget component. Live Track Widget

  2. 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...
  );
}
  1. 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