0.0.5 • Published 10 months ago

@capgo/capacitor-fingerprint v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@capgo/capacitor-fingerprint

Capacitor client for Fingerprint PRO. 100% accurate device identification for fraud detection.

Install

npm install @capgo/capacitor-fingerprint
npx cap sync

API

load(...)

load(options: LoadOptions) => Promise<void>
ParamType
optionsLoadOptions

getVisitorId(...)

getVisitorId(option?: getVisitor | undefined) => Promise<{ visitorId: VisitorId; }>
ParamType
optiongetVisitor

Returns: Promise<{ visitorId: string; }>


getVisitorData(...)

getVisitorData(options?: getVisitor | undefined) => Promise<{ visitorData: VisitorData; }>
ParamType
optionsgetVisitor

Returns: Promise<{ visitorData: VisitorData; }>


Interfaces

VisitorId

Result of requesting a visitor id

PropTypeDescription
visitorIdstringThe visitor identifier
visitorFoundbooleanIf true, this visitor was found and visited before. If false, this visitor wasn't found and probably didn't visit before.
confidenceConfidenceA confidence score that tells how much the agent is sure about the visitor identifier
zeroTrustZeroTrustAn object that tells what fields were hidden (values replaced with empty data)

Confidence

FingerprintJS Pro v3.8.5 - Copyright (c) FingerprintJS, Inc, 2023 (https://fingerprint.com)

This software contains code from open-source projects: MurmurHash3 by Karan Lyons (https://github.com/karanlyons/murmurHash3.js)

PropTypeDescription
scorenumberA number between 0 and 1 that tells how much the agent is sure about the visitor identifier. The higher the number, the higher the chance of the visitor identifier to be true.
commentstringAdditional details about the score as a human-readable text

ZeroTrust

PropTypeDescription
hiddenFieldsstring[]Fields from the result object that have been hidden (values replaced with empty data)
commentstringAdditional details about the reasons as a human-readable text

getVisitor

PropType
tagsTags
linkedIdstring

ShortVisitorData

Main identification information about the visitor

PropTypeDescription
visitorIdstringThe visitor identifier
requestIdstringThe current request identifier. It's different for every request.
confidenceConfidenceA confidence score that tells how much the agent is sure about the visitor identifier

ExtendedVisitorData

All known identification information about the visitor

PropTypeDescription
visitorFoundbooleanIf true, this visitor was found and visited before. If false, this visitor wasn't found and probably didn't visit before.
ipstringIP address. Only IPv4 are returned.
ipLocationIpLocationIP address location. Can be empty for anonymous proxies
osstringOS name.
osVersionstringOS version
devicestringDevice.
firstSeenAtSeenAtWhen the visitor was seen for the first time
lastSeenAtSeenAtWhen the visitor was seen previous time

IpLocation

IP address location. Can be empty for anonymous proxies.

PropTypeDescription
accuracyRadiusnumberIP address location detection radius. Smaller values (<50mi) are business/residential, medium values (50 < x < 500) are cellular towers (usually), larger values (>= 500) are cloud IPs or proxies, VPNs. Can be missing, in case of Tor/proxies.
latitudenumberLatitude Can be missing, in case of Tor/proxies.
longitudenumberLongitude Can be missing, in case of Tor/proxies.
timezonestringTimezone of the IP address location
postalCodestringPostal code, when available
city{ name: string; }City, when available
subdivisions{ isoCode: string; name: string; }[]Administrative subdivisions array (for example states|provinces -> counties|parishes). Can be empty or missing. When not empty, can contain only top-level administrative units within a country, e.g. a state.
country{ code: string; name: string; }Country, when available. Will be missing for Tor/anonymous proxies.
continent{ code: string; name: string; }Continent, when available. Will be missing for Tor/anonymous proxies.

SeenAt

PropTypeDescription
subscriptionstring | nullThe date and time within your subscription. The string format is ISO-8601.
globalstring | nullThe date and time across all subscription. The string format is ISO-8601.

Type Aliases

LoadOptions

LoaderLoadOptions & { /** The pattern of the JS agent script URL. If multiple endpoints are given, the agent will try them one by one until it finds a working one. If an empty array is given, the agent will throw an error. / scriptUrlPattern?: ScriptUrlPattern; }

LoaderLoadOptions

A portion of LoadOptions that will be available in the loader package

CommonLoadOptions

CommonLoadOptions

ApiKeyOptions & { / Region of the FingerprintJS service server @default 'us' */ region?: Region; / Your custom API endpoint for getting visitor data. If multiple endpoints are given, the agent will try them one by one until it finds a working one. If an empty array is given, the agent will throw an error. @example 'https://fp.example.com' @example 'https://fp.example.com', FingerprintJS.defaultEndpoint / endpoint?: Endpoint; / Your custom TLS endpoint. If multiple endpoints are given, the agent will try them one by one until it finds a working one. If an empty array is given, the TLS request will be skipped. @example 'https://tls.fp.example.com' @example 'https://tls.fp.example.com', FingerprintJS.defaultTlsEndpoint / tlsEndpoint?: TlsEndpoint; / Disables the extra TLS request / disableTls?: boolean; / Override storages name (cookies, localStorage, etc). Should only be used when the default name conflicts with some of your existing names. @default '_vid' / storageKey?: string; / A time delay in milliseconds to use instead of requestIdleCallback when it's unavailable. @default 50 / delayFallback?: number; /** Information about libraries and services used to integrate the JS agent. Each array item means a separate integration, the order doesn't matter. An example of an integration library is FingerprintJS Pro React. */ integrationInfo?: readonly string[]; }

ApiKeyOptions

{ / Public API key */ apiKey?: string; / @deprecated Use the apiKey option instead / token: string; } | { /** Public API key / apiKey: string; /* @deprecated Use the apiKey option instead / token?: string; }

Region

'us' | 'eu' | 'ap'

Endpoint

API endpoint for getting visitor data

string | typeof defaultEndpoint | readonly (string | typeof defaultEndpoint)[]

TlsEndpoint

API endpoint for TLS requests

string | typeof defaultTlsEndpoint | readonly (string | typeof defaultTlsEndpoint)[]

ScriptUrlPattern

A JS agent script URL pattern.

The following substrings are replaced:

  • <version> — the major version of JS agent;
  • <apiKey> — the public key set via the apiKey option;
  • <loaderVersion> — the version of this package;

string | typeof defaultScriptUrlPattern | readonly (string | typeof defaultScriptUrlPattern)[]

VisitorId

string

Tags

Tags are returned in the webhook response so make sure the map you are passing to the library represents a valid JSON.

{ K in string: Tag | Tag[] }

Tag

Tags are returned in the webhook response so make sure the map you are passing to the library represents a valid JSON.

string | number | boolean | Tags

VisitorData

Visitor identification data

ShortVisitorData | ExtendedVisitorData

0.0.5

10 months ago

0.0.4

10 months ago

0.0.1

10 months ago