@fingerprintjs/fingerprintjs-pro-server-api

Node.js wrapper for FingerprintJS Server API

Showing:

Popularity

Downloads/wk

10

GitHub Stars

10

Maintenance

Last Commit

2mos ago

Contributors

1

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

FingerprintJS

Current NPM version Monthly downloads from NPM Discord server # [Beta] FingerprintJS Server API Node.js SDK Node.js wrapper for [FingerprintJS Sever API](https://dev.fingerprintjs.com/docs/server-api)

Usage

Install package

npm i @fingerprintjs/fingerprintjs-pro-server-api

Usage of the Server API

import { FingerprintJsServerApiClient, Region } from 'fingerprintjs-server-api';

// Init client with the give region and api_token
const client = new FingerprintJsServerApiClient({region: Region.Global, apiToken: "<api_token>"});

// Get visitor history
client.getVisitorHistory("<visitorId>").then(visitorHistory => {
    console.log(visitorHistory);
});

Usage of the built-in webhook visit type

const visit = visitWebhookBody as unknown as VisitWebhook;

API


FingerprintJsServerApiClient({region: Region, apiToken: string}) constructor

Creates an instance of the client.

Usage

const client = new FingerprintJsServerApiClient({Region.EU, "<api_token>"});

Params

  • region: Region - a region of the server, possible value Region.EU or Region.Global
  • apiToken: string - API token from the FingerprintJS dashboard

client.getVisitorHistory(visitorId: string, filter?: VisitorHistoryFilter): Promise<VisitorsResponse>

Gets history for the given visitor and given filter, returns a promise with visitor history response.

Usage

client.getVisitorHistory("<visitorId>", filter).then(visitorHistory => {
    console.log(visitorHistory);
});

Params

  • visitorId: string - identifier of the visitor
  • filter?: VisitorHistoryFilter - visitor history filter, more info in the API documentation

Returns

  • Promise<VisitorsResponse> - promise with visitor history response

VisitorHistoryFilter

Filter for querying API - see query parameters.

Usage

const filter = {
    request_id: "<request_id>",
    linked_id: "<linked_id>",
    limit: 5,
    before: "<timeStamp>"
};

Properties

  • request_id: string - filter events by requestId
  • linked_id: string - filter events by custom identifier
  • limit: number - limit scanned results
  • before: number - used to paginate results

Server VisitorsResponse response

{
  "visitorId": "Ibk1527CUFmcnjLwIs4A9",
  "visits": [
    {
      "requestId": "0KSh65EnVoB85JBmloQK",
      "incognito": true,
      "linkedId": "somelinkedId",
      "time": "2019-05-21T16:40:13Z",
      // timestamp of the event with millisecond precision
      "timestamp": 1582299576512,
      "url": "https://www.example.com/login",
      "ip": "61.127.217.15",
      "ipLocation": {
        "accuracyRadius": 10,
        "latitude": 49.982,
        "longitude": 36.2566,
        "postalCode": "61202",
        "timezone": "Europe/Dusseldorf",
        "city": {
          "name": "Dusseldorf"
        },
        "continent": {
          "code": "EU",
          "name": "Europe"
        },
        "country": {
          "code": "DE",
          "name": "Germany"
        },
        "subdivisions": [
          {
            "isoCode": "63",
            "name": "North Rhine-Westphalia"
          }
        ],
      },
      "browserDetails": {
        "browserName": "Chrome",
        "browserMajorVersion": "74",
        "browserFullVersion": "74.0.3729",
        "os": "Windows",
        "osVersion": "7",
        "device": "Other",
        "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....",
      }
    }
  ],
  // optional, if more results are available for pagination.
  "lastTimestamp": 1582299576512
}

Release new version

Change version in package.json to 1.2.3 and push a commit with the message Release 1.2.3, the npm-publish action will create a new tag v1.2.3 and publish the package to the npm registry.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100