Skip to content

Commit

Permalink
Merge pull request #45 from fingerprintjs/docs/INTER-279-requirements…
Browse files Browse the repository at this point in the history
…-section

INTER-279 Add requirements section
  • Loading branch information
TheUnderScorer authored Sep 28, 2023
2 parents 07de091 + b336a16 commit 5ae5fab
Show file tree
Hide file tree
Showing 24 changed files with 4,363 additions and 5,544 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/coverage-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ jobs:
checks: write
pull-requests: write
uses: fingerprintjs/dx-team-toolkit/.github/workflows/coverage-diff.yml@v1
with:
testScript: yarn test
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,35 @@

# FingerprintJS Pro Svelte

FingerprintJS Pro Svelte SDK is an easy way to integrate [Fingerprint Pro](https://fingerprint.com/) into your Svelte or [Svelte-kit](https://kit.svelte.dev/) application. See example apps in the [examples](./examples) folder.
[Fingerprint](https://fingerprint.com/) 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](https://kit.svelte.dev/) application. See example apps in the [examples](./examples) folder.

## Requirements

- Svelte 4.0.0 or higher
- For TypeScript users: use Typescript 4.8 or higher
- For SvelteKit users: SvelteKit 1.0.0 or higher

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](https://dev.fingerprint.com/docs/pro-vs-open-source).

## Installation

Yarn:
```shell
yarn add @fingerprintjs/fingerprintjs-pro-svelte
```

Or:

npm:
```shell
npm install @fingerprintjs/fingerprintjs-pro-svelte
```

pnpm:
```shell
pnpm add @fingerprintjs/fingerprintjs-pro-svelte
```

## Getting started

In order to identify visitors, you'll need a Fingerprint Pro account (you can [sign up for free](https://dashboard.fingerprint.com/signup/)).
Expand Down Expand Up @@ -136,9 +149,12 @@ This library uses Fingerprint Pro JavaScript agent under the hood. See our docum

The `getData` function throws errors directly from the JS Agent without changing them. See [JS Agent error handling](https://dev.fingerprint.com/docs/js-agent#error-handling) for more details.

## Support and feedback

To report problems, ask questions or provide feedback, please use [Issues](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/issues). If you need private support, you can email us at [[email protected]](mailto:[email protected]).

## License

This project is licensed under the MIT license. See the [LICENSE](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/blob/main/LICENSE) file for more info.
This project is licensed under the [MIT license](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/blob/main/LICENSE).


5 changes: 3 additions & 2 deletions __tests__/TestApp.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
import { useVisitorData, GetDataOptions } from '../src/lib';
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useVisitorData } from '../src/lib';
export let immediate = false;
export let ignoreCache = false;
export let getDataOptions: GetDataOptions = {};
export let getDataOptions: any = {};
const { getData, data, isLoading, error } = useVisitorData({ extendedResult: true, ignoreCache }, { immediate });
</script>
Expand Down
7 changes: 4 additions & 3 deletions __tests__/TestAppWrapper.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<script lang="ts">
/* eslint-disable @typescript-eslint/no-explicit-any */
import FpjsProvider from '../src/lib/providers/FpjsProvider.svelte';
import { FpjsSvelteOptions, GetDataOptions } from '../src/lib';
import TestApp from './TestApp.svelte';
export let ignoreCache = false;
export let immediate = false;
export let getDataOptions: GetDataOptions = {};
export let getDataOptions: any = {};
const options: FpjsSvelteOptions = {
const options = {
loadOptions: {
apiKey: process.env.API_KEY as string,
},
Expand Down
10 changes: 6 additions & 4 deletions __tests__/setup.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/* eslint-disable @typescript-eslint/no-explicit-any */

import * as dotenv from 'dotenv';
import { jest } from '@jest/globals';

dotenv.config();

export const init = jest.fn();
export const getVisitorData = jest.fn();
export const clearCache = jest.fn();
export const init = jest.fn<any>();
export const getVisitorData = jest.fn<any>();
export const clearCache = jest.fn<any>();

jest.mock('@fingerprintjs/fingerprintjs-pro-spa', () => {
return {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
...(jest.requireActual('@fingerprintjs/fingerprintjs-pro-spa') as any),
FpjsClient: jest.fn(() => {
return {
Expand Down
6 changes: 3 additions & 3 deletions examples/spa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.30",
"@sveltejs/vite-plugin-svelte": "^2.4.6",
"svelte": "link:../../node_modules/svelte",
"vite": "^2.9.16"
"vite": "link:../../node_modules/vite"
},
"dependencies": {
"@fingerprintjs/fingerprintjs-pro-svelte": "link:../../dist"
"@fingerprintjs/fingerprintjs-pro-svelte": "link:../.."
}
}
Loading

0 comments on commit 5ae5fab

Please sign in to comment.