Skip to content

Commit

Permalink
Merge pull request #124 from fingerprintjs/update-spa-package-INTER-249
Browse files Browse the repository at this point in the history
Bump spa package version to 1.1.2
  • Loading branch information
ilfa authored Sep 14, 2023
2 parents d1d02b5 + 01d5024 commit 74d5263
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
},
"homepage": "https://github.com/fingerprintjs/fingerprintjs-pro-react#readme",
"dependencies": {
"@fingerprintjs/fingerprintjs-pro-spa": "^1.1.0",
"@fingerprintjs/fingerprintjs-pro-spa": "^1.1.2",
"fast-deep-equal": "3.1.3"
},
"devDependencies": {
Expand Down
9 changes: 8 additions & 1 deletion src/components/fpjs-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { PropsWithChildren, useCallback, useEffect, useMemo, useRef } from 'react'
import { FpjsContext } from '../fpjs-context'
import { FpjsClient, FpjsClientOptions, GetOptions } from '@fingerprintjs/fingerprintjs-pro-spa'
import * as FingerprintJS from '@fingerprintjs/fingerprintjs-pro'
import * as packageInfo from '../../package.json'
import { isSSR } from '../ssr'
import { waitUntil } from '../utils/wait-until'
Expand All @@ -9,12 +10,16 @@ import type { EnvDetails } from '../env.types'

const pkgName = packageInfo.name.split('/')[1]

interface CustomAgent {
load: (options: FingerprintJS.LoadOptions) => Promise<FingerprintJS.Agent>
}
interface FpjsProviderOptions extends FpjsClientOptions {
/**
* If set to `true`, will force FpjsClient to be rebuilt with the new options. Should be used with caution
* since it can be triggered too often (e.g. on every render) and negatively affect performance of the JS agent.
*/
forceRebuild?: boolean
customAgent?: CustomAgent
}

/**
Expand Down Expand Up @@ -61,6 +66,7 @@ function ProviderWithEnv<TExtended extends boolean>({
cacheTimeInSeconds,
cachePrefix,
cacheLocation,
customAgent,
loadOptions,
env,
}: PropsWithChildren<ProviderWithEnvProps>) {
Expand All @@ -73,9 +79,10 @@ function ProviderWithEnv<TExtended extends boolean>({
cacheTimeInSeconds,
cachePrefix,
cacheLocation,
customAgent,
loadOptions,
}
}, [loadOptions, cache, cacheTimeInSeconds, cachePrefix, cacheLocation])
}, [loadOptions, cache, cacheTimeInSeconds, cachePrefix, cacheLocation, customAgent])

const createClient = useCallback(() => {
let integrationInfo = `${pkgName}/${packageInfo.version}`
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -827,18 +827,18 @@
minimatch "^3.1.2"
strip-json-comments "^3.1.1"

"@fingerprintjs/fingerprintjs-pro-spa@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@fingerprintjs/fingerprintjs-pro-spa/-/fingerprintjs-pro-spa-1.1.0.tgz#3a1924c4bdc91599ecc41971d01b9e38ec1b18d5"
integrity sha512-mj+8zl70lwtibQYdZUN5yUO6Bhw8/MxhbzNolBOp8asCdsXCEEx5DYzRADijQ73vJgimb+ys5zrQ9sZ8O7W0iw==
"@fingerprintjs/fingerprintjs-pro-spa@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@fingerprintjs/fingerprintjs-pro-spa/-/fingerprintjs-pro-spa-1.1.2.tgz#7b4a7ef2a82fa93e879df23edc7dcce0afc5967f"
integrity sha512-tyJli+s1TbPYDG3n56g7N6u2RWjDRrb9v5lolDAxcgniIlgMNKcbLx0+/gEw/6dk2FzKrG6BbXXh/YLHGCh5iA==
dependencies:
"@fingerprintjs/fingerprintjs-pro" "^3.8.4"
"@fingerprintjs/fingerprintjs-pro" "^3.8.5"
tslib "^2.5.0"

"@fingerprintjs/fingerprintjs-pro@^3.8.4":
version "3.8.4"
resolved "https://registry.yarnpkg.com/@fingerprintjs/fingerprintjs-pro/-/fingerprintjs-pro-3.8.4.tgz#d73f7d4da986bf0c10226464e87092e3b50ac0b8"
integrity sha512-6m2fTydRjuiM8y02AoUJcOXZuXblHCLmKH3Huu7sgmxDhogTAm1JO0QsF4rigM6hedlFRAejcozBEteqWRZWew==
"@fingerprintjs/fingerprintjs-pro@^3.8.5":
version "3.8.5"
resolved "https://registry.yarnpkg.com/@fingerprintjs/fingerprintjs-pro/-/fingerprintjs-pro-3.8.5.tgz#9e14b5fadd14a90490be66ddd0d2678f56ac39e1"
integrity sha512-07bkz/BrQYIHh0FIQ8rMKx62IKu+gkZrUzNsoT1fLwYfnM0uk+s+XQXLeaDXGMGpHgkZSP4nPMAn+nkRfWy6ww==
dependencies:
tslib "^2.4.1"

Expand Down

0 comments on commit 74d5263

Please sign in to comment.