Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@fingerprintjs/fingerprintjs-pro-svelte
Advanced tools
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.
This package works with Fingerprint Pro, it is not compatible with open-source FingerprintJS. See our documentation to learn more about the difference between Fingerprint Pro and the open-source FingerprintJS.
Yarn:
yarn add @fingerprintjs/fingerprintjs-pro-svelte
npm:
npm install @fingerprintjs/fingerprintjs-pro-svelte
pnpm:
pnpm add @fingerprintjs/fingerprintjs-pro-svelte
In order to identify visitors, you'll need a Fingerprint Pro account (you can sign up for free). To get your API key and get started, see the Quick start guide in our documentation.
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.// App.svelte
<script>
import { FpjsProvider, /* defaultEndpoint, defaultScriptUrlPattern */ } from '@fingerprintjs/fingerprintjs-pro-svelte'
import VisitorData from './VisitorData.svelte'
const options = {
loadOptions: {
apiKey: '<YOUR_API_KEY>',
// region: 'eu',
// endpoint: ['metrics.yourwebsite.com', defaultEndpoint],
// scriptUrlPattern: ['metrics.yourwebsite.com/agent-path', defaultScriptUrlPattern],
},
};
</script>
<FpjsProvider {options}>
<VisitorData />
</FpjsProvider>
useVisitorData
function in your svelte components to indentify visitors and get the results.// VisitorData.svelte
<script>
import { useVisitorData } from '@fingerprintjs/fingerprintjs-pro-svelte';
// Set to true fo fetch data when component is mounted
export let immediate = false;
const { getData, data, isLoading, error } = useVisitorData({ extendedResult: true }, { immediate });
$: {
if ($data) {
// Do something with visitorData here
}
}
</script>
<div>
<button id='get_data' on:click={() => getData()}> Get data</button>
{#if $isLoading}
<div id='loading'>Loading...</div>
{/if}
{#if $error}
<div id='error'>Error occurred: {$error.message}</div>
{/if}
{#if $data}
<div>
<!--visitorData is available here!-->
</div>
{/if}
</div>
See the full code in the provided example applications.
Fingerprint Pro usage is billed per API call. To reduce API calls, it is a good practice to cache identification results. The SDK uses SessionStorage to cache results by default.
:warning: WARNING If you use data from
extendedResult
, pay additional attention to the caching strategy.Some fields from the extendedResult (e.g.,
ip
orlastSeenAt
) might change over time for the same visitor. If you need to get the latest results, pass{ignoreCache: true}
to thegetData()
function.
See the generated SDK API reference here.
This library uses Fingerprint Pro JavaScript agent under the hood. See our documentation for the full JavaScript Agent API reference.
The getData
function throws errors directly from the JS Agent without changing them. See JS Agent error handling for more details.
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.
This project is licensed under the MIT license.
FAQs
FingerprintJS Pro integration for Svelte
The npm package @fingerprintjs/fingerprintjs-pro-svelte receives a total of 398 weekly downloads. As such, @fingerprintjs/fingerprintjs-pro-svelte popularity was classified as not popular.
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.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.