Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nest-fingerprint

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nest-fingerprint

A fingerprint recognition library from http request for nestjs

  • 0.0.2
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Nestjs Fingerprint

NPM JavaScript Style Guide

Features

  • Generate fingerprint for each browser or device
  • Function decorator support
  • Set cookie

Installation

npm install --save nestjs-fingerprint

or

yarn add nestjs-fingerprint

Usage

app.module.ts

import { Module } from '@nestjs/common';
import { NestjsFingerprintModule } from 'nestjs-fingerprint';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [
    NestjsFingerprintModule.forRoot({
      params: ['headers', 'userAgent', 'ipAddress'],
      cookieOptions: {
        isSetCookie: true,
        httpOnly: true,
      },
    }),
  ],
  controllers: [AppController],
  providers: [AppService],
})

export class AppModule {}

app.controller.ts

import { Controller, Get } from '@nestjs/common';
import { Fingerprint, IFingerprint } from 'nestjs-fingerprint';

@Controller()
export class AppController {
  @Get()
  getFingerprint(@Fingerprint() fp: IFingerprint): IFingerprint {
    return fp
  }
}

Fingerprint example:

{
  "id": "79c0678d8672fafb932a97a1368d7bf3",
  "headers": {
    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "language": "en-US,en;q=0.9"
  },
  "userAgent": {
    "browser": {
      "family": "Chrome",
      "version": "xxx"
    },
    "device": {
      "family": "Other",
      "version": "0"
    },
    "os": {
      "family": "Windows",
      "major": "10",
      "minor": "0"
    }
  },
  "ipAddress": {
    "value": "xxx.xxx.xxx.xxx"
  }
}

License

MIT © l1ttps

FAQs

Package last updated on 30 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc