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.

39 lines (38 loc) 2.24 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'; /** * Determines if the current user is likely operating as a bot by evaluating multiple environmental signals. * * If executed outside of a browser environment, it returns a default bot detection result with a confidence score of 0.8. * The function inspects the user agent for known bot patterns and checks for indicators such as the webdriver flag, * missing storage APIs, few browser plugins, small screen dimensions, and unusual hardware concurrency. * * It computes a weighted confidence score by aggregating strong, medium, and weak signals, capping the final score at 0.9. * A score exceeding 0.7 indicates bot-like behavior. * * @returns An object containing: * - isBot: A boolean value that is true if bot-like behavior is detected. * - signals: An array of strings describing the detected signals with their associated strength. * - confidence: The computed confidence score reflecting the likelihood of bot detection. */ export declare function detectBot(): { isBot: boolean; signals: string[]; confidence: number; }; /** * Asynchronously collects detailed system information from the browser, including OS, browser, device, privacy settings, and bot detection results. * * Gathers a comprehensive set of attributes such as user agent, hardware capabilities, display properties, privacy modes, browser features, and environmental fingerprints. Performs bot detection and computes an overall confidence score. Returns mock data if not executed in a browser environment. * * @returns A promise that resolves to a SystemInfo object containing all collected system and browser details. */ export declare function getSystemInfo(): Promise<SystemInfo>;