<p align="center">
  <br>
  <a href="https://fingerprint.com">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/fingerprintjs/library-template-typescript/4565c620a936fa4a503facc6f206d6626b68d5fc/resources/logo_light.svg" />
      <source media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/fingerprintjs/library-template-typescript/4565c620a936fa4a503facc6f206d6626b68d5fc/resources/logo_dark.svg" />
      <img src="resources/logo_dark.svg" alt="Fingerprint logo" width="312px" />
    </picture>
  </a>
</p>

Makes a website visitor identifier from a browser fingerprint.
Unlike cookies and local storage, fingerprint stays the same in incognito/private mode and even when browser data is purged.
Provides additional information and higher accuracy compared to Open Source FingerprintJS.

## Quick start

Get a pro key:

1. Register a new PRO account at [dashboard.fingerprint.com/signup](https://dashboard.fingerprint.com/signup) (there is a free trial)
2. After registration go to the [dashboard](https://dashboard.fingerprint.com) and select the created subscription
3. Go the "API Keys" page in the navigation side bar on the left side of the page
4. Copy a key with type "Public"

### Install from NPM

```bash
npm i @fingerprintjs/fingerprintjs-pro
# or
yarn add @fingerprintjs/fingerprintjs-pro
```

```js
import FingerprintJS from '@fingerprintjs/fingerprintjs-pro'

// Initialize an agent at application startup.
const fpPromise = FingerprintJS.load({ apiKey: 'your-pro-key' })

;(async () => {
  // Get the visitor identifier when you need it.
  const fp = await fpPromise
  const result = await fp.get()

  // This is the visitor identifier:
  const visitorId = result.visitorId
  console.log(visitorId)
})()
```

[Run this code](https://stackblitz.com/edit/fpjs-pro-3-npm?file=index.js&devtoolsheight=100)

### Alternatively you can install from CDN

```html
<script>
  // Initialize the agent at application startup.
  const fpPromise = import('https://fpcdn.io/v3/your-pro-key')
    .then(FingerprintJS => FingerprintJS.load())

  // Get the visitor identifier when you need it.
  fpPromise
    .then(fp => fp.get())
    .then(result => {
      // This is the visitor identifier:
      const visitorId = result.visitorId
      console.log(visitorId)
    })
</script>
```

Note that you need to replace `your-pro-key` with a public API key from the [dashboard](https://dashboard.fingerprint.com).

[Run this code](https://stackblitz.com/edit/fpjs-pro-3-cdn?file=index.html&devtoolsheight=100)

## See also

🍿 [Live demo](https://fingerprint.com/demo)

⏱ [How to upgrade from Open Source to Pro in 30 seconds](https://dev.fingerprint.com/v3/docs/migrating-from-open-source-v3)

⬆️ [How to migrate from FingerprintJS Pro version 2](https://dev.fingerprint.com/v3/docs/migrating-from-pro-v2)

📕 [FingerprintJS Pro documentation](https://dev.fingerprint.com)

▶️ [Video: use FingerprintJS Pro to prevent multiple signups](https://www.youtube.com/watch?v=jWX9P5_jZn8)
