Fingerprint is a device intelligence platform offering 99.5% accurate visitor identification.
FingerprintJS Pro Svelte SDK is an easy way to integrate Fingerprint into your Svelte or Svelte-kit application. See example apps in the examples folder.
Requirements
Svelte 4.0.0 or higher
For TypeScript users: use Typescript 4.8 or higher
Wrap your application (or component) in FpjsProvider. You can specify multiple configuration options. Set a region if you have chosen a non-global region during registration. Set endpoint and scriptUrlPattern if you are using one of our proxy integrations to increase accuracy and effectiveness of visitor identification.
The visitorId provided by Fingerprint Identification is especially useful when combined with information you already know about your users, for example, account IDs, order IDs, etc. To learn more about various applications of the linkedId and tag, see Linking and tagging information.
Associate the visitor ID with your data using the linkedId or tag parameter of the options object passed into the useVisitorData() hook:
Fingerprint Pro usage is billed per API call. To avoid unnecessary API calls, it is a good practice to cache identification results. By default, the SDK uses sessionStorage to cache results.
Specify the cacheLocation prop on <FpjsProvider> to instead store results in memory or localStorage. Use none to disable caching completely.
Specify the cache prop on <FpjsProvider> to use your custom cache implementation instead. For more details, see Creating a custom cache
in the Fingerprint Pro SPA repository (a lower-level Fingerprint library used by this SDK).
Pass {ignoreCache: true} to the getData() function to ignore cached results for that specific API call.
[!NOTE]
If you use data from extendedResult, pay additional attention to your caching strategy.
Some fields, for example, ip or lastSeenAt, might change over time for the same visitor. Use getData({ ignoreCache: true }) to fetch the latest identification results.
This library uses Fingerprint Pro JavaScript agent under the hood. See our documentation for the full JavaScript Agent API reference.
Error handling
The getData function throws errors directly from the JS Agent without changing them. See JS Agent error handling for more details.
Support and feedback
To report problems, ask questions or provide feedback, please use Issues. If you need private support, you can email us at oss-support@fingerprint.com.
We found that @fingerprintjs/fingerprintjs-pro-svelte demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 22 Jul 2024
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.