UNPKG

fingerprint-oss

Version:

A comprehensive JavaScript library for device fingerprinting and system information collection. Provides robust, deterministic fingerprinting for web applications with privacy-conscious design.

73 lines (72 loc) 2.95 kB
/*! * Copyright (c) 2025 Akshat Kotpalliwar (alias IntegerAlex on GitHub) * This software is licensed under the GNU Lesser General Public License (LGPL) v3 or later. * * You are free to use, modify, and redistribute this software, but modifications must also be licensed under the LGPL. * This project is distributed without any warranty; see the LGPL for more details. * * For a full copy of the LGPL and ethical contribution guidelines, please refer to the `COPYRIGHT.md` and `NOTICE.md` files. */ import { SystemInfo } from './types.js'; import { GeolocationInfo } from './geo-ip.js'; /** * Generates a structured JSON object combining geolocation data, system information, and confidence assessments. * * The returned object includes interpreted confidence scores for both the system and an optional combined assessment, details about potential network threats (such as proxies, VPNs, Tor, or hosting providers), geolocation information with VPN status, and a unique hash derived from the system information. * * @param geolocationInfo - Geolocation data for the user (can be null in test environments). * @param systemInfo - Information about the user's system, including confidence score and bot detection signals. * @param combinedConfidenceScore - An optional overall confidence score to be interpreted and included in the assessment. * @returns An object containing confidence assessments, geolocation details (with VPN status), system information, and a unique hash. */ export declare function generateJSON(geolocationInfo: GeolocationInfo | null, systemInfo: SystemInfo, combinedConfidenceScore?: number): Promise<{ confidenceAssessment: { combined?: { factors: string; rating: string; description: string; reliability: string; level: "low" | "medium-low" | "medium" | "medium-high" | "high"; score: number; } | undefined; system: { factors: string; rating: string; description: string; reliability: string; level: "low" | "medium-low" | "medium" | "medium-high" | "high"; score: number; }; }; geolocation: { vpnStatus: Object | undefined; ip: string; city: string; region: { isoCode: string; name: string; }; country: { isoCode: string; name: string; }; continent: { code: string; name: string; }; location: { accuracyRadius: number; latitude: number; longitude: number; timeZone: string; }; traits: { isAnonymous: boolean; isAnonymousProxy: boolean; isAnonymousVpn: boolean; network: string; }; } | null; systemInfo: SystemInfo; hash: string; }>;