The Fingerprint Svelte SDK is an easy way to integrate Fingerprint into your Svelte application. It supports all capabilities of the JS agent and provides a built-in caching mechanism.

How to install

Add @fingerprintjs/fingerprintjs-pro-svelte as a dependency to your application via npm or yarn.

npm install @fingerprintjs/fingerprintjs-pro-svelte
yarn add @fingerprintjs/fingerprintjs-pro-svelte

Wrap your application (or component) in FpjsProvider. You need to specify your public API key and other configuration options based on your chosen region and active integration.

// src/App.svelte
  import {
    // defaultEndpoint,
    // defaultScriptUrlPattern
  } from '@fingerprintjs/fingerprintjs-pro-svelte'
  import VisitorData from './VisitorData.svelte'
    loadOptions: {
      apiKey: "<PUBLIC_API_KEY>",
      // endpoint: ["<CUSTOM_ENDPOINT>", defaultEndpoint],
      // scriptUrlPattern: ["<CUSTOM_SCRIPT_URL>", defaultScriptUrlPattern],
      // region: "eu"
  <VisitorData />

Use the useVisitorData hook in your components to identify visitors.

// src/VisitorData.svelte
  import { useVisitorData } from '@fingerprintjs/fingerprintjs-pro-svelte';
  const { getData, data, isLoading, error } = useVisitorData(
    { extendedResult: true },
    { immediate: false }

  <button on:click={() => getData()}>Get visitor data</button>
  {#if $isLoading} Loading... {/if}
  {#if $error} {$error.message} {/if}
  {#if $data}
    <pre>{JSON.stringify($data, null, 2)}</pre>


You can find the full documentation in the official GitHub repository. The repository also contains example applications demonstrating the usage of the library.