This repository is considered deprecated and will be archived.
FullStory has released an official browser SDK - @fullstory/browser, which you can find here.
This is an Angular wrapper for the Full.Story JavaScript SDK.
Initial version of code is originally from https://github.com/CaliStyle/ng-fullstory, modified just to get something up and running that can identify my users. The old library seems to not be working anymore.
I will continuously update the library and might introduce breaking changes in the next version.
-
Install via npm
npm install --save ngx-fullstory
-
Import FullstoryModule
import { FullstoryModule } from 'ngx-fullstory'; @NgModule({ imports: [ ... FullstoryModule.forRoot({ fsOrg: <your_fs_org>, // from your Fullstory config }) ... ] }) export class AppModule { }
-
Use in your component
import { Component, OnInit } from '@angular/core'; import { Fullstory } from 'ngx-fullstory'; @Component({ selector: 'app', template: `...` }) export class AppComponent implements OnInit, OnDestroy { constructor( public fullstory: Fullstory ){} ngOnInit() { this.fullstory.login(<user id>, { displayName: <user display name>, email: <user email>, other: <properties> }); } ngOnDestroy() { this.fullstory.logout(); } }
If you want to publish a new version of this package, bump up the version in
package.json
package-lock.json
projects/ngx-fullstory/package.json
and then run
npm run publish-lib
.