@kovalenko/ng-fingerprint
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

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

Package Sidebar

Install

npm i @kovalenko/ng-fingerprint

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

26.8 kB

Total Files

14

Last publish

Collaborators

  • kovalenko