Web frameworks
Learn how to integrate LiveSession with popular web frameworks and services.
Quick Start
First, install the LiveSession Browser SDK:
Then initialize LiveSession in your application:
Start recording:
Angular
In your src/app/app.component.ts, initialize LiveSession using your project tracking code.
You can find it in your project settings.
Astro
In your src/components/LiveSession.astro, initialize LiveSession using your project tracking code.
You can find it in your project settings.
then add the component to your layout:
Next.js
In your src/app/livesession.tsx, initialize LiveSession using your project tracking code.
You can find it in your project settings.
then the provider to your root layout:
Nuxt
Create a plugin for LiveSession in plugins/livesession.ts and initialize LiveSession using your project tracking code.
You can find it in your project settings.
React
In your src/main.tsx, initialize LiveSession using your project tracking code.
You can find it in your project settings.
React Router
In your app/components/LiveSession.tsx, initialize LiveSession using your project tracking code.
You can find it in your project settings.
then add the component to your root layout:
Svelte (SvelteKit)
In src/routes/+layout.ts, initialize LiveSession using your project tracking code.
You can find it in your project settings.
Vue
In src/main.ts, initialize LiveSession using your project tracking code.
You can find it in your project settings.
Gatsby
- Install gatsby-plugin-livesession
- Go to gatsby-config.js
- Configure a plugin like in following example:
Read more about an options you can provide here.
Plugin adds code to your site only in production mode.
Capacitor
In general LiveSession support that technology, but you must be sure that resources on your app are available publicly on the Internet.
If you use local server for some reasons you'll need to pass baseURL option like the following:
For example if you set up your local server
with hostname:'frontend', androidScheme:'capacitor-app' and
href to css in your app is /static/style.css the following style resource must be available
at https://your-site.com/static/style.css assuming you set baseURL to https://you-site.com
Electron
Electron doesn't natively support cookies, so LiveSession JavaScript web tracking code won't work because internally we use client-side cookies. We're currently working on a of the electron-cookies package to support tracking.
In the future we'll switch to another browser storage instead of cookies and Electron should works out of the box.
So, to use LiveSession in Electron apps you should:
- Install electron-cookies package
- Configure a like in following example:
The browser cookies needs to know the current URL, but in Electron files are usually served from local filesystem which is not compatibile with cookies. Treat origin as a special key for cookies store within all data is saved.
Read more about a package here.
Sample Projects
Check out our sample projects for complete examples of LiveSession integration with each framework.
Show your support! Star us on GitHub ⭐️