- Import the agent directly from a CDN (fastest for a quick test).
- Install the agent loader using NPM (includes TypeScript support).
- Use a frontend SDK for your specific framework like React, Vue, Svelte, or Angular (recommended, includes built-in caching strategies and framework-specific APIs).
Sandboxed iframe not supportedDo not run the JavaScript agent inside a sandboxed iframe. This setup is not supported and may prevent the agent from functioning properly.

Importing from a CDN
This is the easiest way to start. It’s also known as ESM import.- Add the HTML code below to your page.
- Use your public API key at the end of the URL, right after
/v3/, for example:https://fpjscdn.net/v3/YOUR_PUBLIC_API_KEY.
HTML
HTML
Installing the agent loader using NPM
The Fingerprint NPM package works as a loader for the JavaScript agent. It does not contain the JavaScript agent code itself; instead, it’s responsible for downloading the agent from a CDN at runtime. We routinely update the JavaScript agent to keep up with the latest browser releases. The NPM package ensures your website always uses the latest, most accurate version of the agent without frequently updating your NPM dependencies and redeploying your application.- The NPM package includes TypeScript types for a better development experience.
- The package is compatible with various module bundlers such as Webpack and Rollup.
- Install the @fingerprintjs/fingerprintjs-pro NPM package using your favorite package manager.
- Import the package into your code:
JavaScript
- Pass your public API key as
apiKeyinto theload()function.
import * as FingerprintJS from) instead of a default import ( import FingerprintJS from) will result in a slightly smaller bundle size due to improved tree-shaking.
Alternatively, you can use the legacy CommonJS standard:
JavaScript
Using a framework-specific SDK
We have SDKs for the following frameworks: The SDKs wrap the agent loader NPM package described above, meaning the latest fingerprinting logic is still downloaded from a CDN at runtime. The SDKs expose the JavaScript agent functionality through framework-specific APIs (for example, a provider component and a hook in React). They also have caching and other best practices built in. If you can, we recommend using one of the framework SDKs above. You can go to Dashboard > SDKs & integrations to get started with personalized code snippets for the SDKs.
Configuring the agent
No matter which installation methods you pick above, you need to initialize the agent with your API key, region, proxy endpoints, and other load options. See the JavaScript Agent API Reference for a detailed description of all load options. Most users will need the following four options:apiKey: Go to Dashboard > API keys to find your public API key.region: If you choose to store your data in the EU or Asia Pacific region, you need to specify it in the region load option.endpointandscriptUrlPattern: Requests to Fingerprint CDN and API can be blocked by ad blockers. For maximum coverage, we recommend proxying Fingerprint requests through your own domain or subdomain. See Proxy integrations for more information. Once you have a proxy integration in place, you will use theendpointandscriptUrlPatternload options to specify the proxy endpoints for agent download and identification requests. For the CDN installation method, use the proxy endpoint for agent download directly in theimportstatement.
- If you used the CDN or NPM loader installation methods, you can pass the load options as an object into the
FingerprintJS.load()method. Once you have the promise of the JavaScript agent instance, you can resolve it and callget()to send an identification requests to Fingerprint API. - If you used a framework-specific client SDK, please refer to its documentation for the SDK-specific way of passing the load options object to the JavaScript agent.
What’s next
- Continue by reading Identify visitors to learn best practices for timing identification requests, caching visitor information, or using linked IDs to associate your own identifiers with each visitor ID.
- See Configure Content Security policy to make sure the JavaScript agent is not blocked by your own CSP.
- Concerned about performance and latency? Read our guide on Optimizing JavaScript agent loading.
- Ready for a deep dive? Explore the full JavaScript agent API Reference.
- To learn about equivalent SDKs for mobile devices, see Android and iOS.