@kovalenko/ng-fingerprint
v1.1.1
Published
Angular service wrapper for fingerprintjs2
Downloads
6
Readme
NgFingerprint
Angular service wrapper for fingerprintjs2
Installation
npm install @kovalenko/ng-fingerprint
Usage
First, import the NgFingerprintModule to your module:
import {NgModule} from '@angular/core';
import {BrowserModule} from '@angular/platform-browser';
import {NgFingerprintModule} from '@kovalenko/ng-fingerprint';
import {platformBrowserDynamic} from '@angular/platform-browser-dynamic';
import {AppComponent} from './app';
@NgModule({
imports: [
BrowserModule,
NgFingerprintModule.config('localstorageItemName')
],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule {
}
platformBrowserDynamic().bootstrapModule(AppModule);
Then inject NgFingerprintService into your component:
import {Component} from '@angular/core';
import {NgFingerprintService} from '@kovalenko/ng-fingerprint';
@Component({
selector: 'app',
template: ``,
})
export class AppComponent {
constructor(private ngFingerprintService: NgFingerprintService) {
ngFingerprintService.fingerprint.subscribe(fp => {
// ...
});
}
}
License
MIT