@capgo/capacitor-fingerprint
v0.0.5
Published
Capacitor client for Fingerprint PRO. 100% accurate device identification for fraud detection.
Downloads
7
Readme
@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>
| Param | Type |
| ------------- | --------------------------------------------------- |
| options
| LoadOptions |
getVisitorId(...)
getVisitorId(option?: getVisitor | undefined) => Promise<{ visitorId: VisitorId; }>
| Param | Type |
| ------------ | ------------------------------------------------- |
| option
| getVisitor |
Returns: Promise<{ visitorId: string; }>
getVisitorData(...)
getVisitorData(options?: getVisitor | undefined) => Promise<{ visitorData: VisitorData; }>
| Param | Type |
| ------------- | ------------------------------------------------- |
| options
| getVisitor |
Returns: Promise<{ visitorData: VisitorData; }>
Interfaces
VisitorId
Result of requesting a visitor id
| Prop | Type | Description |
| ------------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| visitorId
| string | The visitor identifier |
| visitorFound
| boolean | If true, this visitor was found and visited before. If false, this visitor wasn't found and probably didn't visit before. |
| confidence
| Confidence | A confidence score that tells how much the agent is sure about the visitor identifier |
| zeroTrust
| ZeroTrust | An 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)
| Prop | Type | Description |
| ------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| score
| number | A 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. |
| comment
| string | Additional details about the score as a human-readable text |
ZeroTrust
| Prop | Type | Description |
| ------------------ | --------------------- | ------------------------------------------------------------------------------------- |
| hiddenFields
| string[] | Fields from the result object that have been hidden (values replaced with empty data) |
| comment
| string | Additional details about the reasons as a human-readable text |
getVisitor
| Prop | Type |
| -------------- | ------------------------------------- |
| tags
| Tags |
| linkedId
| string |
ShortVisitorData
Main identification information about the visitor
| Prop | Type | Description |
| ---------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------- |
| visitorId
| string | The visitor identifier |
| requestId
| string | The current request identifier. It's different for every request. |
| confidence
| Confidence | A confidence score that tells how much the agent is sure about the visitor identifier |
ExtendedVisitorData
All known identification information about the visitor
| Prop | Type | Description |
| ------------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| visitorFound
| boolean | If true, this visitor was found and visited before. If false, this visitor wasn't found and probably didn't visit before. |
| ip
| string | IP address. Only IPv4 are returned. |
| ipLocation
| IpLocation | IP address location. Can be empty for anonymous proxies |
| os
| string | OS name. |
| osVersion
| string | OS version |
| device
| string | Device. |
| firstSeenAt
| SeenAt | When the visitor was seen for the first time |
| lastSeenAt
| SeenAt | When the visitor was seen previous time |
IpLocation
IP address location. Can be empty for anonymous proxies.
| Prop | Type | Description |
| -------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| accuracyRadius
| number | IP 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. |
| latitude
| number | Latitude Can be missing, in case of Tor/proxies. |
| longitude
| number | Longitude Can be missing, in case of Tor/proxies. |
| timezone
| string | Timezone of the IP address location |
| postalCode
| string | Postal 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
| Prop | Type | Description |
| ------------------ | --------------------------- | -------------------------------------------------------------------------- |
| subscription
| string | null | The date and time within your subscription. The string format is ISO-8601. |
| global
| string | null | The 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