Skip to main content
All CollectionsInstall LiveSession
Install LiveSession on GatsbyJS
Install LiveSession on GatsbyJS

Install LiveSession on Gatsby.js site

Kamil avatar
Written by Kamil
Updated over 11 months ago

LiveSession and Gatsby integration

LiveSession provides a plugin that lets you install script even more easily.

In your project run

npm i @livesession/gatsby-plugin-livesession

or

yarn add @livesession/gatsby-plugin-livesession

Go to gatsby-config.js file and add a plugin, everything that you need is trackID:

// gatsby-config.js 
plugins: [{
resolve: '@livesession/gatsby-plugin-livesession',
options: {
trackID: YOUR_LIVESESSION_TRACKID, // Required, string
keystrokes: true || false, // Optional, default to false
rootHostname: '.example.com', // Optional
},
}];

Plugin adds script only in production mode.

If you want to know more about options you can pass into config, go to LiveSesion Developers page.

Did this answer your question?