Skip to main content
All CollectionsInstall LiveSession
Install LiveSession with Angular application
Install LiveSession with Angular application

Learn how to install LiveSession with Angular.js

Kamil avatar
Written by Kamil
Updated over a year ago

LiveSession provides an SDK package to install script in your favorite framework. This tool also lets you work more easily with LiveSesion API. We’ve prepared some examples of installing tracking code in Angular.

Start with installing LiveSesion SDK:

npm i @livesession/sdk

Angular usage

  1. Import SDK into your main app component

  2. Import OnInit from @angular/core

  3. Implement OnInit and call LiveSession init method in ngOnInit function

// app.component.ts 
import ls from '@livesession/sdk'
export class AppComponent implemets OnInit {
ngOnInit(){
ls.init("YOUR_TRACK_ID");
ls.newPageView();
}
}

If you want more information about configuration, go to LiveSesion Developers or read instructions on LiveSesion SDK’s Github page.

Did this answer your question?