@fingerprintiq/js 0.1.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/LICENSE +21 -0
- package/README.md +69 -0
- package/dist/index.cjs +28 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +406 -0
- package/dist/index.d.ts +406 -0
- package/dist/index.global.js +28 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/** Configuration for the FingerprintIQ SDK */
|
|
2
|
+
interface FingerprintIQConfig {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
timeout?: number;
|
|
6
|
+
detectWallets?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface SignalResult<T = unknown> {
|
|
9
|
+
value: T;
|
|
10
|
+
duration: number;
|
|
11
|
+
}
|
|
12
|
+
interface CanvasSignal {
|
|
13
|
+
hash: string;
|
|
14
|
+
isFarbled: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface WebGLSignal {
|
|
17
|
+
renderer: string;
|
|
18
|
+
vendor: string;
|
|
19
|
+
extensions: string[];
|
|
20
|
+
params: Record<string, number>;
|
|
21
|
+
gpuTimingMs: number | null;
|
|
22
|
+
isSoftwareRenderer: boolean;
|
|
23
|
+
}
|
|
24
|
+
interface WebGPUSignal {
|
|
25
|
+
available: boolean;
|
|
26
|
+
vendor: string;
|
|
27
|
+
architecture: string;
|
|
28
|
+
device: string;
|
|
29
|
+
description: string;
|
|
30
|
+
features: string[];
|
|
31
|
+
}
|
|
32
|
+
interface AudioSignal {
|
|
33
|
+
hash: string;
|
|
34
|
+
sampleRate: number;
|
|
35
|
+
maxChannelCount: number;
|
|
36
|
+
isSuspended: boolean;
|
|
37
|
+
}
|
|
38
|
+
interface FontSignal {
|
|
39
|
+
detected: string[];
|
|
40
|
+
count: number;
|
|
41
|
+
isSpoofed: boolean;
|
|
42
|
+
}
|
|
43
|
+
interface WebRTCSignal {
|
|
44
|
+
localIpHash: string | null;
|
|
45
|
+
candidateCount: number;
|
|
46
|
+
candidateTypes: string[];
|
|
47
|
+
multipleNics: boolean;
|
|
48
|
+
}
|
|
49
|
+
interface WasmTimingSignal {
|
|
50
|
+
medianMs: number;
|
|
51
|
+
stddevMs: number;
|
|
52
|
+
}
|
|
53
|
+
interface NavigatorSignal {
|
|
54
|
+
hardwareConcurrency: number;
|
|
55
|
+
deviceMemory: number | null;
|
|
56
|
+
maxTouchPoints: number;
|
|
57
|
+
languages: string[];
|
|
58
|
+
platform: string;
|
|
59
|
+
cookieEnabled: boolean;
|
|
60
|
+
doNotTrack: string | null;
|
|
61
|
+
keyboardLayout: string | null;
|
|
62
|
+
connectionType: string | null;
|
|
63
|
+
hasBluetooth: boolean;
|
|
64
|
+
hasUsb: boolean;
|
|
65
|
+
hasHid: boolean;
|
|
66
|
+
hasSerial: boolean;
|
|
67
|
+
hasWakeLock: boolean;
|
|
68
|
+
hasGpu: boolean;
|
|
69
|
+
bluetoothAvailable: boolean | null;
|
|
70
|
+
}
|
|
71
|
+
interface MediaSignal {
|
|
72
|
+
colorScheme: string;
|
|
73
|
+
contrast: string;
|
|
74
|
+
forcedColors: boolean;
|
|
75
|
+
pointer: string;
|
|
76
|
+
hover: string;
|
|
77
|
+
displayMode: string;
|
|
78
|
+
reducedMotion: boolean;
|
|
79
|
+
colorGamut: string;
|
|
80
|
+
}
|
|
81
|
+
interface ScreenSignal {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
availWidth: number;
|
|
85
|
+
availHeight: number;
|
|
86
|
+
colorDepth: number;
|
|
87
|
+
pixelRatio: number;
|
|
88
|
+
isFirefoxRfp: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface IntegritySignal {
|
|
91
|
+
tamperedApis: string[];
|
|
92
|
+
workerMismatch: boolean;
|
|
93
|
+
lieScore: number;
|
|
94
|
+
}
|
|
95
|
+
interface WalletSignal {
|
|
96
|
+
detected: string[];
|
|
97
|
+
count: number;
|
|
98
|
+
evmProviders: string[];
|
|
99
|
+
solanaProviders: string[];
|
|
100
|
+
multipleWallets: boolean;
|
|
101
|
+
versions: Record<string, string>;
|
|
102
|
+
}
|
|
103
|
+
interface StorageSignal {
|
|
104
|
+
localStorage: boolean;
|
|
105
|
+
sessionStorage: boolean;
|
|
106
|
+
indexedDb: boolean;
|
|
107
|
+
cookie: boolean;
|
|
108
|
+
survivingMechanisms: string[];
|
|
109
|
+
}
|
|
110
|
+
interface MathSignal {
|
|
111
|
+
values: number[];
|
|
112
|
+
hash: string;
|
|
113
|
+
}
|
|
114
|
+
interface DOMRectSignal {
|
|
115
|
+
hash: string;
|
|
116
|
+
emojiHash: string;
|
|
117
|
+
rectCount: number;
|
|
118
|
+
}
|
|
119
|
+
interface HeadlessSignal {
|
|
120
|
+
isHeadless: boolean;
|
|
121
|
+
markers: string[];
|
|
122
|
+
}
|
|
123
|
+
interface SpeechSignal {
|
|
124
|
+
voiceCount: number;
|
|
125
|
+
localVoices: string[];
|
|
126
|
+
remoteVoiceCount: number;
|
|
127
|
+
defaultVoice: string | null;
|
|
128
|
+
hash: string;
|
|
129
|
+
}
|
|
130
|
+
interface IntlSignal {
|
|
131
|
+
locales: string[];
|
|
132
|
+
formattedNumber: string;
|
|
133
|
+
formattedRelativeTime: string;
|
|
134
|
+
formattedList: string;
|
|
135
|
+
localeSpoofed: boolean;
|
|
136
|
+
hash: string;
|
|
137
|
+
}
|
|
138
|
+
interface TimezoneSignal {
|
|
139
|
+
reported: string;
|
|
140
|
+
computed: string | null;
|
|
141
|
+
offsetHistorical: number;
|
|
142
|
+
isSpoofed: boolean;
|
|
143
|
+
hash: string;
|
|
144
|
+
}
|
|
145
|
+
interface CssStyleSignal {
|
|
146
|
+
propertyCount: number;
|
|
147
|
+
systemColorHash: string;
|
|
148
|
+
systemFontHash: string;
|
|
149
|
+
hash: string;
|
|
150
|
+
}
|
|
151
|
+
interface ErrorSignal {
|
|
152
|
+
messages: string[];
|
|
153
|
+
hash: string;
|
|
154
|
+
}
|
|
155
|
+
interface WorkerScopeSignal {
|
|
156
|
+
workerNavigator: {
|
|
157
|
+
hardwareConcurrency: number;
|
|
158
|
+
platform: string;
|
|
159
|
+
languages: string[];
|
|
160
|
+
userAgent: string;
|
|
161
|
+
} | null;
|
|
162
|
+
workerWebGL: {
|
|
163
|
+
renderer: string;
|
|
164
|
+
vendor: string;
|
|
165
|
+
} | null;
|
|
166
|
+
mismatches: string[];
|
|
167
|
+
}
|
|
168
|
+
interface ResistanceSignal {
|
|
169
|
+
browser: string | null;
|
|
170
|
+
extensions: string[];
|
|
171
|
+
timerPrecisionMs: number;
|
|
172
|
+
}
|
|
173
|
+
interface SvgSignal {
|
|
174
|
+
hash: string;
|
|
175
|
+
textLengths: number[];
|
|
176
|
+
}
|
|
177
|
+
interface WindowFeaturesSignal {
|
|
178
|
+
propertyCount: number;
|
|
179
|
+
webkitCount: number;
|
|
180
|
+
mozCount: number;
|
|
181
|
+
litterKeys: string[];
|
|
182
|
+
hash: string;
|
|
183
|
+
}
|
|
184
|
+
interface HtmlElementSignal {
|
|
185
|
+
propertyCount: number;
|
|
186
|
+
hash: string;
|
|
187
|
+
}
|
|
188
|
+
interface CodecSignal {
|
|
189
|
+
matrix: Record<string, {
|
|
190
|
+
canPlay: string;
|
|
191
|
+
mediaSource: boolean;
|
|
192
|
+
mediaRecorder: boolean;
|
|
193
|
+
}>;
|
|
194
|
+
hash: string;
|
|
195
|
+
}
|
|
196
|
+
interface StatusSignal {
|
|
197
|
+
timingResolution: number;
|
|
198
|
+
maxStackSize: number;
|
|
199
|
+
storageQuotaMB: number | null;
|
|
200
|
+
battery: {
|
|
201
|
+
charging: boolean;
|
|
202
|
+
level: number;
|
|
203
|
+
} | null;
|
|
204
|
+
heapLimit: number | null;
|
|
205
|
+
}
|
|
206
|
+
interface PlatformFeaturesSignal {
|
|
207
|
+
features: Record<string, boolean>;
|
|
208
|
+
estimatedPlatform: string;
|
|
209
|
+
hash: string;
|
|
210
|
+
}
|
|
211
|
+
interface UAClientHintsBrand {
|
|
212
|
+
brand: string;
|
|
213
|
+
version: string;
|
|
214
|
+
}
|
|
215
|
+
interface UAClientHintsSignal {
|
|
216
|
+
available: boolean;
|
|
217
|
+
mobile: boolean | null;
|
|
218
|
+
platform: string | null;
|
|
219
|
+
architecture: string | null;
|
|
220
|
+
bitness: string | null;
|
|
221
|
+
model: string | null;
|
|
222
|
+
platformVersion: string | null;
|
|
223
|
+
wow64: boolean | null;
|
|
224
|
+
formFactors: string[];
|
|
225
|
+
brands: UAClientHintsBrand[];
|
|
226
|
+
fullVersionList: UAClientHintsBrand[];
|
|
227
|
+
hash: string | null;
|
|
228
|
+
}
|
|
229
|
+
interface CapabilityVectorSignal {
|
|
230
|
+
pdfViewerEnabled: boolean | null;
|
|
231
|
+
globalPrivacyControl: boolean | null;
|
|
232
|
+
hasPdfPlugin: boolean;
|
|
233
|
+
pluginCount: number | null;
|
|
234
|
+
hasWebGPU: boolean;
|
|
235
|
+
hasVirtualKeyboard: boolean;
|
|
236
|
+
hasSpeechSynthesis: boolean;
|
|
237
|
+
hasSpeechRecognition: boolean;
|
|
238
|
+
hasMediaCapabilities: boolean;
|
|
239
|
+
hasKeyboardLayoutApi: boolean;
|
|
240
|
+
hasBluetooth: boolean;
|
|
241
|
+
hasUsb: boolean;
|
|
242
|
+
hasHid: boolean;
|
|
243
|
+
hasSerial: boolean;
|
|
244
|
+
hasHighEntropyUaHints: boolean;
|
|
245
|
+
suspiciousFlags: string[];
|
|
246
|
+
hash: string;
|
|
247
|
+
}
|
|
248
|
+
interface GeometryVectorSignal {
|
|
249
|
+
screen: {
|
|
250
|
+
width: number;
|
|
251
|
+
height: number;
|
|
252
|
+
availWidth: number;
|
|
253
|
+
availHeight: number;
|
|
254
|
+
};
|
|
255
|
+
window: {
|
|
256
|
+
innerWidth: number;
|
|
257
|
+
innerHeight: number;
|
|
258
|
+
outerWidth: number;
|
|
259
|
+
outerHeight: number;
|
|
260
|
+
devicePixelRatio: number;
|
|
261
|
+
};
|
|
262
|
+
visualViewport: {
|
|
263
|
+
width: number;
|
|
264
|
+
height: number;
|
|
265
|
+
scale: number;
|
|
266
|
+
offsetLeft: number;
|
|
267
|
+
offsetTop: number;
|
|
268
|
+
} | null;
|
|
269
|
+
orientation: {
|
|
270
|
+
type: string | null;
|
|
271
|
+
angle: number | null;
|
|
272
|
+
};
|
|
273
|
+
chromeInsetX: number | null;
|
|
274
|
+
chromeInsetY: number | null;
|
|
275
|
+
suspiciousFlags: string[];
|
|
276
|
+
hash: string;
|
|
277
|
+
}
|
|
278
|
+
interface RuntimeVectorSignal {
|
|
279
|
+
hardwareConcurrency: number;
|
|
280
|
+
deviceMemory: number | null;
|
|
281
|
+
timingResolutionMs: number | null;
|
|
282
|
+
maxStackSize: number | null;
|
|
283
|
+
storageQuotaMB: number | null;
|
|
284
|
+
jsHeapUsedMB: number | null;
|
|
285
|
+
jsHeapTotalMB: number | null;
|
|
286
|
+
jsHeapLimitMB: number | null;
|
|
287
|
+
networkRttMs: number | null;
|
|
288
|
+
downlinkMbps: number | null;
|
|
289
|
+
saveData: boolean | null;
|
|
290
|
+
suspiciousFlags: string[];
|
|
291
|
+
hash: string;
|
|
292
|
+
}
|
|
293
|
+
interface SensorCapabilitiesSignal {
|
|
294
|
+
apis: Record<string, boolean>;
|
|
295
|
+
permissionStates: Record<string, string | null>;
|
|
296
|
+
policyBlocked: string[];
|
|
297
|
+
availableCount: number;
|
|
298
|
+
hash: string;
|
|
299
|
+
}
|
|
300
|
+
interface BehavioralRiskSignal {
|
|
301
|
+
elapsedMs: number;
|
|
302
|
+
totalEventCount: number;
|
|
303
|
+
pointerMoveCount: number;
|
|
304
|
+
pointerDistancePx: number;
|
|
305
|
+
pointerDirectionChanges: number;
|
|
306
|
+
pointerStraightness: number | null;
|
|
307
|
+
clickCount: number;
|
|
308
|
+
scrollEventCount: number;
|
|
309
|
+
scrollBurstCount: number;
|
|
310
|
+
keyEventCount: number;
|
|
311
|
+
inputEventCount: number;
|
|
312
|
+
focusTransitions: number;
|
|
313
|
+
blurTransitions: number;
|
|
314
|
+
visibilityTransitions: number;
|
|
315
|
+
meanPointerIntervalMs: number | null;
|
|
316
|
+
meanKeyIntervalMs: number | null;
|
|
317
|
+
classification: "insufficient_data" | "low_interaction" | "human_like" | "synthetic_like";
|
|
318
|
+
riskScore: number;
|
|
319
|
+
reasons: string[];
|
|
320
|
+
hash: string;
|
|
321
|
+
}
|
|
322
|
+
interface IncognitoSignal {
|
|
323
|
+
isPrivate: boolean;
|
|
324
|
+
method: string | null;
|
|
325
|
+
}
|
|
326
|
+
interface DevToolsSignal {
|
|
327
|
+
isOpen: boolean;
|
|
328
|
+
indicators: string[];
|
|
329
|
+
}
|
|
330
|
+
interface VirtualizationSignal {
|
|
331
|
+
vmDetected: boolean;
|
|
332
|
+
emulatorDetected: boolean;
|
|
333
|
+
indicators: string[];
|
|
334
|
+
confidence: "low" | "medium" | "high";
|
|
335
|
+
}
|
|
336
|
+
interface RootedSignal {
|
|
337
|
+
detected: boolean;
|
|
338
|
+
confidence: "low" | "medium";
|
|
339
|
+
indicators: string[];
|
|
340
|
+
}
|
|
341
|
+
interface ClientSignals {
|
|
342
|
+
canvas: SignalResult<CanvasSignal> | null;
|
|
343
|
+
webgl: SignalResult<WebGLSignal> | null;
|
|
344
|
+
webgpu: SignalResult<WebGPUSignal> | null;
|
|
345
|
+
audio: SignalResult<AudioSignal> | null;
|
|
346
|
+
fonts: SignalResult<FontSignal> | null;
|
|
347
|
+
webrtc: SignalResult<WebRTCSignal> | null;
|
|
348
|
+
wasmTiming: SignalResult<WasmTimingSignal> | null;
|
|
349
|
+
navigator: SignalResult<NavigatorSignal> | null;
|
|
350
|
+
media: SignalResult<MediaSignal> | null;
|
|
351
|
+
screen: SignalResult<ScreenSignal> | null;
|
|
352
|
+
integrity: SignalResult<IntegritySignal> | null;
|
|
353
|
+
wallets: SignalResult<WalletSignal> | null;
|
|
354
|
+
storage: SignalResult<StorageSignal> | null;
|
|
355
|
+
math: SignalResult<MathSignal> | null;
|
|
356
|
+
domRect: SignalResult<DOMRectSignal> | null;
|
|
357
|
+
headless: SignalResult<HeadlessSignal> | null;
|
|
358
|
+
speech: SignalResult<SpeechSignal> | null;
|
|
359
|
+
intl: SignalResult<IntlSignal> | null;
|
|
360
|
+
timezone: SignalResult<TimezoneSignal> | null;
|
|
361
|
+
cssStyle: SignalResult<CssStyleSignal> | null;
|
|
362
|
+
error: SignalResult<ErrorSignal> | null;
|
|
363
|
+
workerScope: SignalResult<WorkerScopeSignal> | null;
|
|
364
|
+
resistance: SignalResult<ResistanceSignal> | null;
|
|
365
|
+
svg: SignalResult<SvgSignal> | null;
|
|
366
|
+
windowFeatures: SignalResult<WindowFeaturesSignal> | null;
|
|
367
|
+
htmlElement: SignalResult<HtmlElementSignal> | null;
|
|
368
|
+
codec: SignalResult<CodecSignal> | null;
|
|
369
|
+
status: SignalResult<StatusSignal> | null;
|
|
370
|
+
platformFeatures: SignalResult<PlatformFeaturesSignal> | null;
|
|
371
|
+
uaClientHints: SignalResult<UAClientHintsSignal> | null;
|
|
372
|
+
capabilityVector: SignalResult<CapabilityVectorSignal> | null;
|
|
373
|
+
geometryVector: SignalResult<GeometryVectorSignal> | null;
|
|
374
|
+
runtimeVector: SignalResult<RuntimeVectorSignal> | null;
|
|
375
|
+
sensorCapabilities: SignalResult<SensorCapabilitiesSignal> | null;
|
|
376
|
+
behavioralRisk: SignalResult<BehavioralRiskSignal> | null;
|
|
377
|
+
incognito: SignalResult<IncognitoSignal> | null;
|
|
378
|
+
devTools: SignalResult<DevToolsSignal> | null;
|
|
379
|
+
virtualization: SignalResult<VirtualizationSignal> | null;
|
|
380
|
+
rooted: SignalResult<RootedSignal> | null;
|
|
381
|
+
}
|
|
382
|
+
interface IdentifyResponse {
|
|
383
|
+
visitorId: string;
|
|
384
|
+
confidence: number;
|
|
385
|
+
botProbability: number;
|
|
386
|
+
signals: Record<string, unknown>;
|
|
387
|
+
wallets?: WalletSignal;
|
|
388
|
+
timestamp: number;
|
|
389
|
+
visitCount: number;
|
|
390
|
+
firstSeenAt: number;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
declare function getDiscoveredAddresses(): string[];
|
|
394
|
+
declare function requestWalletConnection(): Promise<string | null>;
|
|
395
|
+
|
|
396
|
+
declare class FingerprintIQ {
|
|
397
|
+
private readonly apiKey;
|
|
398
|
+
private readonly endpoint;
|
|
399
|
+
private readonly timeout;
|
|
400
|
+
private readonly detectWallets;
|
|
401
|
+
constructor(config: FingerprintIQConfig);
|
|
402
|
+
private ensureClientHintsBootstrapped;
|
|
403
|
+
identify(): Promise<IdentifyResponse>;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
export { type AudioSignal, type BehavioralRiskSignal, type CanvasSignal, type CapabilityVectorSignal, type ClientSignals, type CodecSignal, type CssStyleSignal, type DOMRectSignal, type ErrorSignal, type FingerprintIQConfig, type FontSignal, type GeometryVectorSignal, type HeadlessSignal, type HtmlElementSignal, type IdentifyResponse, type IntegritySignal, type IntlSignal, type MathSignal, type MediaSignal, type NavigatorSignal, type PlatformFeaturesSignal, type ResistanceSignal, type RuntimeVectorSignal, type ScreenSignal, type SensorCapabilitiesSignal, type SpeechSignal, type StatusSignal, type StorageSignal, type SvgSignal, type TimezoneSignal, type UAClientHintsBrand, type UAClientHintsSignal, type WalletSignal, type WasmTimingSignal, type WebGLSignal, type WebGPUSignal, type WebRTCSignal, type WindowFeaturesSignal, type WorkerScopeSignal, FingerprintIQ as default, getDiscoveredAddresses, requestWalletConnection };
|