@fingerly/svelte 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,11 @@ and no `$` prefix at the call site.
11
11
  pnpm add @fingerly/svelte
12
12
  ```
13
13
 
14
+ **Not for apps.** This binding runs the browser SDK, which collects nothing
15
+ inside an app's web view (Capacitor, Cordova, Ionic, React Native WebView,
16
+ `WKWebView`, Android `WebView`, Electron). Use the Fingerly iOS or Android SDK
17
+ in an app; see [docs/privacy.md §3.3](../../../docs/privacy.md).
18
+
14
19
  ## Set it up
15
20
 
16
21
  ```svelte
@@ -20,7 +25,7 @@ pnpm add @fingerly/svelte
20
25
 
21
26
  let { children } = $props()
22
27
 
23
- // consent: 'granted' only once you have consent (or another lawful basis)
28
+ // consent: 'granted' only once you have consent (or know none is required here; see docs/privacy.md §4)
24
29
  setupFingerly({ apiKey: 'fly_pk_production_…', endpoints: '/k7x2qm4a', consent: 'granted' })
25
30
  </script>
26
31
 
@@ -209,7 +214,6 @@ fingerly.visitorConfidence // number: 0 to 100
209
214
  fingerly.identifiable // boolean: false when the signals were too thin
210
215
  fingerly.duplicate // boolean: answered before; this is the first answer
211
216
  fingerly.state // string | null: the server's disposition
212
- fingerly.reason // string | null: always null (deprecated); your backend reads it on the event
213
217
  fingerly.suspectScore // number | null: null when nothing scored it
214
218
  fingerly.suspectLevel // string | null: low, medium, high
215
219
  fingerly.report // SignalReport | null: every source, with status and timing
@@ -80,9 +80,6 @@ export function useIdentify(options = {}) {
80
80
  get state() {
81
81
  return fingerly.state;
82
82
  },
83
- get reason() {
84
- return fingerly.reason;
85
- },
86
83
  get suspectScore() {
87
84
  return fingerly.suspectScore;
88
85
  },
@@ -19,10 +19,9 @@ import { type ConsentState, type FingerlyClient, type IdentifyResult, type Signa
19
19
  export interface FingerlyOptions {
20
20
  /** The SDK key from the dashboard. A public key is safe in a page. */
21
21
  apiKey: string;
22
- /** Origin of the API. Defaults to production. */
23
22
  /** API route version. Defaults to v1. */
24
23
  apiVersion?: string;
25
- endpoint?: string;
24
+ /** Ordered first-party ingestion endpoints. */
26
25
  endpoints?: string | readonly string[];
27
26
  fallbackToDefaultEndpoint?: boolean;
28
27
  /**
@@ -39,7 +38,7 @@ export interface FingerlyOptions {
39
38
  *
40
39
  * Leave it `pending` while identification waits on a consent banner, then
41
40
  * call [[Fingerly.setConsent]] when it is answered, or pass `granted`
42
- * once you have consent (or another lawful basis). Until then nothing is
41
+ * once you have consent (or know none is required here; see docs/privacy.md §4). Until then nothing is
43
42
  * collected or sent: `useIdentify({ immediate: true })` waits, and a manual
44
43
  * `identify()` fails with a `ConsentError` in `error`.
45
44
  */
@@ -64,12 +63,6 @@ export interface Fingerly {
64
63
  readonly duplicate: boolean;
65
64
  /** The server's disposition of the check. */
66
65
  readonly state: string | null;
67
- /**
68
- * @deprecated Always `null`. A browser is no longer told why a check went
69
- * unscored; your backend reads `reason` on the server-side event read, by
70
- * `requestId`. Kept so code written against 0.1.0 still compiles.
71
- */
72
- readonly reason: string | null;
73
66
  /**
74
67
  * The server's score, 0-100, or null when it did not score.
75
68
  *
@@ -82,7 +82,6 @@ export function createFingerly(options) {
82
82
  // here would escape every caller's .catch and leave isLoading stuck.
83
83
  clientPromise ??= Promise.resolve().then(() => load({
84
84
  apiKey: options.apiKey,
85
- ...(options.endpoint === undefined ? {} : { endpoint: options.endpoint }),
86
85
  ...(options.apiVersion === undefined ? {} : { apiVersion: options.apiVersion }),
87
86
  ...(options.endpoints === undefined ? {} : { endpoints: options.endpoints }),
88
87
  ...(options.fallbackToDefaultEndpoint === undefined ? {} : { fallbackToDefaultEndpoint: options.fallbackToDefaultEndpoint }),
@@ -192,10 +191,6 @@ export function createFingerly(options) {
192
191
  get state() {
193
192
  return checkState;
194
193
  },
195
- get reason() {
196
- // Deprecated: the server no longer tells a browser. See the interface.
197
- return null;
198
- },
199
194
  get suspectScore() {
200
195
  return suspectScore;
201
196
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fingerly/svelte",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "sideEffects": false,
28
28
  "dependencies": {
29
- "@fingerly/web-js": "0.1.1"
29
+ "@fingerly/web-js": "0.2.0"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "svelte": ">=5"