> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fingerprint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrating from FingerprintJS v2 to Pro

> Update from FingerprintJS Open-Source version 2 to Fingerprint version 3

How to update from [FingerprintJS Open-Source v2](https://github.com/fingerprintjs/fingerprintjs/tree/v2) to Fingerprint:

1. Sign up on [dashboard.fingerprint.com/signup](https://dashboard.fingerprint.com/signup), create an account, and get a public API key.

2. Change the `@fingerprintjs/fingerprintjs` or `fingerprintjs2` package to `@fingerprintjs/fingerprintjs-pro`. If you use NPM, run:

   <CodeGroup>
     ```bash NPM theme={"theme":"github-dark-dimmed"}
     npm remove @fingerprintjs/fingerprintjs fingerprintjs2 @types/fingerprintjs__fingerprintjs @types/fingerprintjs2
     npm install @fingerprintjs/fingerprintjs-pro
     ```

     ```bash Yarn theme={"theme":"github-dark-dimmed"}
     # 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 @fingerprintjs/fingerprintjs-pro
     ```
   </CodeGroup>

   And replace the package name in your JavaScript/TypeScript code:

   <CodeGroup>
     ```javascript JavaScript theme={"theme":"github-dark-dimmed"}
     import Fingerprint2 from '@fingerprintjs/fingerprintjs' // [!code --]
     import Fingerprint2 from 'fingerprintjs2' // [!code --]
     import FingerprintJS from '@fingerprintjs/fingerprintjs-pro' // [!code ++]
     ```
   </CodeGroup>

   If you use a CDN, switch to our CDN:

   <CodeGroup>
     ```html HTML theme={"theme":"github-dark-dimmed"}
     <script src="https://cdn.jsdelivr.net/npm/fingerprintjs2@2/dist/fingerprint2.min.js"></script> <!-- [!code --] -->
     <script src="https://fpjscdn.net/v3/<<browserToken>>/iife.min.js"></script> <!-- [!code ++] -->
     <script>...</script>
     ```
   </CodeGroup>

3. Replace `requestIdleCallback` with `FingerprintJS.load`. The function will return a promise that resolves with an agent object. The agent has a `get` method that you will use instead of calling `Fingerprint2.get` directly:

   <CodeGroup>
     ```javascript JavaScript theme={"theme":"github-dark-dimmed"}
     requestIdleCallback(() => { // [!code --]
       Fingerprint2.get(result => { // [!code --]
         const fpPromise = FingerprintJS.load() // [!code ++]
         fpPromise // [!code ++]
           .then(fp => fp.get()){ // [!code ++]
           .then(result => { // [!code ++]
             // Handle the result
           })
     - })
     ```
   </CodeGroup>

4. Add the public API key to the `FingerprintJS.load()` configuration:

   <CodeGroup>
     ```javascript NPM/Yarn theme={"theme":"github-dark-dimmed"}
     FingerprintJS.load() // [!code --]
     FingerprintJS.load({ apiKey: '<<browserToken>>' }) // [!code ++]
     ```

     ```txt CDN theme={"theme":"github-dark-dimmed"}
     Put the key to the agent script URL:
     https://fpjscdn.net/v3/YOUR_PUBLIC_KEY

     For example:
     https://fpjscdn.net/v3/token
     https://fpjscdn.net/v3/token/iife.min.js
     ```
   </CodeGroup>

5. Use the visitor identifier directly (the raw components aren't provided):

   <CodeGroup>
     ```javascript JavaScript theme={"theme":"github-dark-dimmed"}
       fp.get().then(result => {
        const values = result.map(function (component) { return component.value }) // [!code --]
        const visitorId = Fingerprint2.x64hash128(values.join(''), 31) // [!code --]
        const visitorId = result.visitorId // [!code ++]
       })
     ```
   </CodeGroup>

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](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) polyfill. See the [browser support guide](/docs/browser-and-device-support#browsers) to get a list of the supported browsers.

***
