4.x.x), which allowed us to introduce breaking changes and requires customers to manually migrate. The new agent ensures that we are ready for continuous scaling and that our customers can benefit from reliable features along with latency and accuracy improvements.
What’s new
- The new agent matches our recently released Server API v4 in terminology and the event format. This makes it easier to integrate across frontend and backend implementations, significantly reducing the time required to adopt new features.
- Removed deprecated configuration options:
tlsDisabledandtlsEndpoint, which made it possible to configure the old TLS endpoint. If you used this option, use theendpointsoption instead, and let us know if you see any missing capabilities.extendedResultbecame redundant as aget()option after the introduction of Smart Signals and Sealed Client Results. All information is sent to the client in a secure and encrypted form instead, if configured.Use sealed_result instead.scriptUrlPatternwas removed. Use theendpointsoption if you need to configure a specific domain for agent script download.- The
productsfield has been completely removed, as it had no impact on agent behavior anymore. This field does not have any replacement.
storageKeywas renamed tostorageKeyPrefixand it does not add a leading underscore any more. SeestorageKey migration guidebelow for details. Be careful as this might have negative impact on accuracy if set up incorrectly.- The
endpointwas renamed toendpointsand is now a string by default (instead of an array).- By default, the
endpointsoption accepts a string but multiple strings can be supplied as an array if fallbacks are required. - Fingerprint’s default endpoints are included as a default fallback, if you don’t want to use the fallback endpoints use the
Fingerprint.withoutDefault()helper.
- By default, the
- The NPM package name changed from
@fingerprintjs/fingerprint-proto@fingerprint/agent - The main namespace has changed from
FingerprintJStoFingerprint. - Stopped supporting the IIFE installation method (NPM and ESM installation methods remain available).
- Our agent now uses the Web Workers API to improve latency and accuracy. This requires you to set up appropriate CSP rules to enable Web Worker code download and execution.
- Added built-in caching options with the
cacheparameter along with predefined values specific in theCacheConfigtype. - Revamped error handling from a fixed enum to more descriptive error messages that contain the resolution steps to get rid of the error.
- The
load()method was renamed tostart()and is now synchronous (does not return a promise). - The agent code is compiled to the ES2018 standard (JS features like
let,constandasyncwork without transpiling). This reduces the code size.
Migration steps
The following section outlines the necessary migration steps to complete the transition from the previous to the current version. The steps are in no specific order and some of them depend on specific installation methods and utilized configuration options.Upgrade the MAJOR package version
IIFE
IIFE installation method has been completely deprecated in4.0.0. See the migration guide from IIFE to other supported installation methods below.
NPM
If you used the NPM installation method, you have to first change the package name from@fingerprintjs/fingerprint-pro to @fingerprint/agent
ESM
If you used the ESM installation method, you need to update the URL string fromv3 to v4
Change the namespace from FingerprintJS to Fingerprint
The FingerprintJS namespace was renamed to Fingerprint to represent our current brand. The FingerprintJS name is supposed to exclusively represent the original open-source @fingerprintjs/fingerprintjs project and not the paid product this documentation focuses on.
Set up new CSP policy rules
If you send theContent-Security-Policy header, you have to update it with new rules to support our new implementation that is using WebWorkers under the hood. The following header values should be added in case of using a Custom Subdomain/Proxy or our default endpoint respectively (in case the endpoints parameter was not used).
Migrate from the IIFE installation method to NPM or ESM
The IIFE installation has been completely deprecated and we recommend migrating to the ESM or NPM installation methods.Migrate storageKey to storageKeyPrefix
If you used the storageKey option in v3, you have to migrate to the new storageKeyPrefix option and add a trailing underscore as that is not added automatically any more.
Use endpoints instead of tlsEndpoint
The tlsEndpoint option (along with disableTls were completely deprecated in favor of the new endpoints option. If you used the tlsEndpoint option to set up a specific domain for the TLS endpoint specifically, you can now use the endpoints option instead.
Use endpoints instead of scriptUrlPattern
scriptUrlPattern was historically used for two different purposes
- To set up a custom subdomain for the agent script download (CDN installation).
- To set up a proxy integration using a first party domain, using special placeholders to tell the agent how to construct the final URL.
endpoints option which follows certain path conventions.
Use sealed_result instead of extendedResult option
The agent get() method now returns only a minimal amount of data to ensure tighter security on the client side. Furthermore, all non-essential fields were now removed but still remain available through the encrypted sealed_result response field.
Remove products, extendedResult, tlsEndpoint and tlsDisabled from options
All of products, extendedResult, tlsEndpoint and tlsDisabled were removed from the get() and start() calls completely. The options need to be removed from the code to prevent errors.
Make the start() method call synchronous
Theload() method in the previous (3.x) version returned a Promise that had to be resolved before getting the agent instance. The new start() method is now synchronous and returns the agent instance immediately.
Change the error handling approach
In v3, errors were exposed as named literals (e.g.,FingerprintJS.ERROR_RATE_LIMIT), and it was necessary to filter specific errors by their respective string values. This made it impossible to change/update the actual message which should be designed to help resolving the errors in the first place.
The current version does not expose any string literals in an enum and the error type is decided by including a code field in the error JSON response instead.