Skip to main content
How to update from FingerprintJS Open-Source v2 to Fingerprint:
  1. Sign up on dashboard.fingerprint.com/signup, create an account, and get a public API key.
  2. Change the @fingerprintjs/fingerprintjs or fingerprintjs2 package to @fingerprint/agent. If you use NPM, run:
    npm remove @fingerprintjs/fingerprintjs fingerprintjs2 @types/fingerprintjs__fingerprintjs @types/fingerprintjs2
    npm install @fingerprint/agent
    
    # Don't mind the "This module isn't specified in a package.json file" error
    yarn remove @fingerprintjs/fingerprintjs fingerprintjs2 @types/fingerprintjs__fingerprintjs @types/fingerprintjs2
    yarn add @fingerprint/agent
    
    And replace the package name in your JavaScript/TypeScript code:
    import Fingerprint2 from '@fingerprintjs/fingerprintjs'
    import Fingerprint2 from 'fingerprintjs2'
    import Fingerprint from '@fingerprint/agent'
    
    If you use a CDN, switch to our CDN:
    <script src="https://cdn.jsdelivr.net/npm/fingerprintjs2@2/dist/fingerprint2.min.js"></script> 
    <script type="module">
      const Fingerprint = await import('https://fpjscdn.net/v4/PUBLIC_API_KEY')
      const fp = Fingerprint.start()
    </script>
    
  3. Replace requestIdleCallback with Fingerprint.start. The function returns an agent object. The agent has a get method that you will use instead of calling Fingerprint2.get directly:
    requestIdleCallback(() => { 
      Fingerprint2.get(result => { 
        // Handle the result
      }) 
    }) 
    const fp = Fingerprint.start({ apiKey: 'PUBLIC_API_KEY' }) 
    fp.get().then(result => { 
      // Handle the result
    }) 
    
  4. Add the public API key to the Fingerprint.start() configuration:
    FingerprintJS.load() 
    Fingerprint.start({ apiKey: 'PUBLIC_API_KEY' }) 
    
    Put the key to the agent script URL:
    https://fpjscdn.net/v4/YOUR_PUBLIC_KEY
    
    For example:
    https://fpjscdn.net/v4/token
    https://fpjscdn.net/v4/token/iife.min.js
    
  5. Use the visitor identifier directly (the raw components aren’t provided):
      fp.get().then(result => {
       const values = result.map(function (component) { return component.value }) 
       const visitorId = Fingerprint2.x64hash128(values.join(''), 31) 
       const visitorId = result.visitor_id 
      })
    
  6. Remember that the support of Internet Explorer 10 and older has been dropped. Some old browsers like Internet Explorer 11 and Android Browser 4.1 require a Promise polyfill. See the browser support guide to get a list of the supported browsers.