Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 1.13 KB

File metadata and controls

40 lines (24 loc) · 1.13 KB

LiveSession + React Router

This is a sample project that demonstrates how to integrate LiveSession with a React Router application.

Prerequisites

  1. LiveSession account, you can create one here.
  2. VITE_LIVESESSION_TRACK_ID environment variable - you can add it to the .env file. Tracking ID can be found in the LiveSession -> Settings -> Websites.

Getting Started

Clone this repository and install the dependencies:

git clone https://github.com/livesession/livesession-browser-samples

cd livesession-browser-samples/react-router

npm i

Start the development server:

npm run dev

Open your browser and navigate to http://localhost:5173.

Sample overview

  1. LiveSession Browser SDK usage with autocapture events.

  2. Basic example how to init LiveSession script in the app/components/LiveSession.tsx file.

  3. Basic example how to use custom events in the app/components/Counter.tsx file (the Counter event name).