Skip to content

Commit

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

Docs/inter 279 requirements section
  • Loading branch information
TheUnderScorer authored Oct 5, 2023
2 parents 07de091 + d4b511f commit 8fe0490
Show file tree
Hide file tree
Showing 26 changed files with 4,386 additions and 5,559 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
13 changes: 1 addition & 12 deletions .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,7 @@
}
],
"@semantic-release/changelog",
[
"@semantic-release/npm",
{
"npmPublish": false
}
],
[
"@semantic-release/npm",
{
"pkgRoot": "dist"
}
],
"@semantic-release/npm",
[
"@semantic-release/exec",
{
Expand Down
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## [2.0.0-test.1](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/compare/v1.3.1...v2.0.0-test.1) (2023-09-28)


### ⚠ BREAKING CHANGES

* minimal supported svelte version is now 4.0.0

### Features

* set minimal supported version to Svelte 4.0.0 ([c32da25](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/commit/c32da2500689450299268fac4f66cdf48f0d7b17))


### Documentation

* **README:** add introducing sentence ([14e9aaf](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/commit/14e9aafe856d2d074c3f0bf1bbabb1774a4da5ff))
* **README:** add pnpm snippet ([a700463](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/commit/a700463d0bd2d2380f5e5a4eb9a3a767b82d2d3d))
* **README:** add requirements section ([d35926d](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/commit/d35926d9c4c15dae1df08b95b88e2f4aa4593792))
* **README:** add support and feedback section ([edd0722](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/commit/edd07222aad2c1d8c74f1f3553f5bb697e8d3a11))

## [1.3.1](https://github.com/fingerprintjs/fingerprintjs-pro-svelte/compare/v1.3.0...v1.3.1) (2023-09-15)


Expand Down
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 [oss-support@fingerprint.com](mailto:oss-support@fingerprint.com).

## 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 8fe0490

Please sign in to comment.