This page contains the API Reference for the JavaScript agent’s function or its equivalent in your frontend library. The function is exported directly from the @fingerprint/agent NPM package. Instead, it is a method on the agent instance returned by the start() function.
Call the get() function to send identification requests to Fingerprint and get the browser’s visitor ID.If you are just getting started with Fingerprint, we recommend reading the following guides first:
Required: no Default: undefinedType: stringConstraint: the number of characters must not exceed 256
linkedId is a way of linking the current analysis event with a custom identifier. This will allow you to filter visit information when using the Server API.
Copy
Ask AI
// Making an API callvar orderId = 3936532456fp.get({ linkedId: orderId })// linkedId will be saved with this event and will be available to be queried later.
If the information stored in linkedId is not available on the client when the event happens, it is possible to set it through our Update Event Server API.To learn more about tag and linkedId use cases, see Linking and tagging information.
Required: no Default: undefinedType: any simple value or an object (not arrays) Constraint: the size must not exceed 16KB
tag is a customer-provided value or an object that is saved with the identification event and returned back to you in a webhook message or Server API response. You can use tag to associate the visit event with other information you have about the visitor.You can use any simple value (string, number, boolean) or an object. An object is saved as provided. A simple value (for example 123) is returned wrapped in an object like this: { "tag": 123 }.Examples of using the tag option:
If the information stored in tag is not available on the client when the event happens, it is possible to set it through our Update Event Server API.To learn more about tag and linkedId use cases, see Linking and tagging information.
Client timeout controls the total time (both client-side and server-side) that any analysis event can run. It doesn’t include the time when the page is in the background (not visible) because the browser may suspend the analysis process during that time. By default, it’s 10 seconds. You can set the client-side timeout in milliseconds using the timeout option. Example usage:
Copy
Ask AI
// A timeout of 20 seconds// An example of the client-side timeout handlingtry { const result = await fp.get({ timeout: 20000 }) // ...} catch (error) { if (error.code === 'client_timeout') { console.log("A timeout of 20 seconds exceeded") }}
Note that setting a low timeout (less than 2000ms) could increase identification failures on weaker devices with slower internet connections.
The browser identifier (or device identifier for mobile platforms)The field will contain an empty string if the visitor can’t be identified, for example, a search bot. If the identification product is disabled, a dummy value is used.