### Example Usage of RecordList Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Demonstrates how to create a RecordList with sample browser and OS data. This data can be used for training. ```typescript const data: RecordList = [ { browser: 'chrome', os: 'windows', version: 100 }, { browser: 'firefox', os: 'linux', version: 95 }, ]; ``` -------------------------------- ### Install Puppeteer Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Install Puppeteer as a peer dependency if you are using it with the Fingerprint Suite. ```bash npm install puppeteer # For Puppeteer ``` -------------------------------- ### Install Playwright Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Install Playwright as a peer dependency if you are using it with the Fingerprint Suite. ```bash npm install playwright # For Playwright ``` -------------------------------- ### Generating Headers with Presets Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/header-generator.md Example of initializing HeaderGenerator with specific browser, OS, device, and locale constraints and then generating headers. This demonstrates using presets for common scenarios. ```typescript const generator = new HeaderGenerator({ browsers: ['chrome'], operatingSystems: ['windows', 'macos'], devices: ['desktop'], locales: ['en-US', 'de-DE'], }); const headers = generator.getHeaders(); ``` -------------------------------- ### Example Generated Browser Headers Source: https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/README.md A sample JSON output representing a set of realistic browser headers that can be generated by the HeaderGenerator. ```json { "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": "\"Windows\"", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36 Edg/119.0.0.0", "accept-encoding": "gzip, deflate, br", "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7", "sec-ch-ua": "\"Microsoft Edge\";v=\"119\", \"Chromium\";v=\"119\", \"Not?A_Brand\";v=\"24\"", "upgrade-insecure-requests": "1", "accept-language": "en-US", "sec-fetch-site": "same-site", "sec-fetch-mode": "navigate", "sec-fetch-user": "?1", "sec-fetch-dest": "document" } ``` -------------------------------- ### Example Browser Specification Array Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/header-generator.md Demonstrates how to define an array of browser specifications, including simple names and detailed objects with version constraints and HTTP version overrides. ```typescript const browsers = [ 'chrome', { name: 'firefox', minVersion: 90 }, { name: 'safari', minVersion: 15, maxVersion: 16, httpVersion: '1' }, ]; ``` -------------------------------- ### VideoCard Type Definition and Example Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/types.md Defines the structure for GPU information extracted from a WebGL context, including the renderer and vendor. An example demonstrates how to access this information from a generated fingerprint. ```typescript type VideoCard = { renderer: string; vendor: string; } const fingerprint = generator.getFingerprint(); console.log(fingerprint.fingerprint.videoCard); // { vendor: "Google Inc.", renderer: "ANGLE (Intel HD Graphics)" } ``` -------------------------------- ### Valid Browser Version for Header Generation Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Provides an example of a realistic and valid browser version for header generation. ```typescript // Realistic version const headers = generator.getHeaders({ browsers: [{ name: 'chrome', minVersion: 120 }], }); ``` -------------------------------- ### Relaxing Screen Constraints for Fingerprint Generation Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md When encountering fingerprint generation failures due to overly restrictive screen dimensions, widen the `maxWidth` and `minWidth` values. This example shows how to adjust from narrow to wider constraints. ```typescript const fp = generator.getFingerprint({ screen: { minWidth: 320, maxWidth: 400, // Too narrow } }); // Use wider constraints const fp = generator.getFingerprint({ screen: { minWidth: 320, maxWidth: 1920, // Wider range } }); ``` -------------------------------- ### Get Headers with Specific Options Source: https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/README.md Retrieve a random set of headers, overriding global options with call-specific parameters for OS and locales. ```javascript let headers = headerGenerator.getHeaders({ operatingSystems: ['linux'], locales: ['en-US', 'en'], }); ``` -------------------------------- ### Configure Playwright Context for Fingerprint Injection Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Ensure the `viewport` is set before fingerprint injection when using `newInjectedContext`. This setup correctly applies the fingerprint's screen and user agent properties to the Playwright context. ```typescript // Must set viewport BEFORE injection in newContext const context = await newInjectedContext(browser, { fingerprintOptions: { /* ... */ }, newContextOptions: { viewport: { width: fingerprint.screen.width, height: fingerprint.screen.height, }, userAgent: fingerprint.navigator.userAgent, }, }); ``` -------------------------------- ### Enabling Constraint Relaxation in Fingerprint Generation Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md When fingerprint generation fails due to conflicting browser/OS combinations, enabling constraint relaxation (default `strict: false`) allows the generator to succeed by adjusting constraints. This example shows how to explicitly set `strict: false` and a scenario where relaxation is beneficial. ```typescript // Already the default - strict: false const generator = new FingerprintGenerator({ strict: false }); // Will automatically relax constraints if generation fails const fp = generator.getFingerprint({ operatingSystems: ['windows'], browsers: [{ name: 'safari' }], // Impossible - Safari is on macOS/iOS }); // Will succeed by relaxing either OS or browser constraints ``` -------------------------------- ### Initialize HeaderGenerator with Options Source: https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/README.md Create an instance of HeaderGenerator with global options for browser, device, and OS. ```javascript import { HeaderGenerator } from 'header-generator'; let headerGenerator = new HeaderGenerator({ browsers: [ { name: 'firefox', minVersion: 90 }, { name: 'chrome', minVersion: 110 }, 'safari', ], devices: ['desktop'], operatingSystems: ['windows'], }); ``` -------------------------------- ### Accessing Node Possible Values Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Shows how to get the array of possible values a BayesianNode can take. ```typescript const node = network.nodesByName['browser']; console.log(node.possibleValues); // ['chrome', 'firefox', 'safari', 'edge'] ``` -------------------------------- ### Initialize HeaderGenerator with a Preset Source: https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/README.md Demonstrates how to initialize the HeaderGenerator with a predefined preset for modern Windows Chrome browsers. ```javascript import { HeaderGenerator, PRESETS } from 'header-generator'; let headerGenerator = new HeaderGenerator(PRESETS.MODERN_WINDOWS_CHROME); ``` -------------------------------- ### Importing Presets Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/header-generator.md Shows how to import the PRESETS object from the header-generator package. Presets offer pre-configured browser/OS combinations. ```typescript import { PRESETS } from 'header-generator'; ``` -------------------------------- ### Bayesian Network Definition JSON Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Example JSON structure for defining nodes, their values, parent nodes, and conditional probabilities in a Bayesian network. ```json { "nodes": [ { "name": "ParentNode", "values": ["A", "B", "C"], "parentNames": [], "conditionalProbabilities": { "A": 0.1, "B": 0.8, "C": 0.1 } }, { "name": "ChildNode", "values": [".", ",", "!", "?"], "parentNames": ["ParentNode"], "conditionalProbabilities": { "A": { ".": 0.7, "!": 0.3 }, "B": { ",": 0.3, "?": 0.7 }, "C": { ".": 0.5, "?": 0.5 } } } ] } ``` -------------------------------- ### FingerprintInjector Class Definition Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md Defines the FingerprintInjector class with methods to attach fingerprints to Playwright and Puppeteer browser contexts/pages, and to get injectable scripts. ```typescript export class FingerprintInjector { attachFingerprintToPlaywright( browserContext: BrowserContext, browserFingerprintWithHeaders: BrowserFingerprintWithHeaders, ): Promise attachFingerprintToPuppeteer( page: Page, browserFingerprintWithHeaders: BrowserFingerprintWithHeaders, ): Promise getInjectableScript( browserFingerprintWithHeaders: BrowserFingerprintWithHeaders, ): string } ``` -------------------------------- ### Instantiate BayesianNetwork Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Create a new Bayesian Network instance by loading a network definition from a specified zip file path. The zip file must contain a 'network.json' file. ```typescript import { BayesianNetwork } from 'generative-bayesian-network'; const network = new BayesianNetwork({ path: '/path/to/network-definition.zip', }); ``` -------------------------------- ### Generate Network Sample Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Generate a sample of node values, optionally given known values for some nodes. ```javascript let sample = generatorNetwork.generateSample({ ParentNode: 'A' }); ``` -------------------------------- ### Inject Fingerprint into Puppeteer Browser Source: https://github.com/apify/fingerprint-suite/blob/master/README.md This example demonstrates how to use fingerprint-injector with Puppeteer to inject a browser fingerprint. It allows for specifying fingerprint generation constraints. ```typescript import puppeteer from 'puppeteer'; import { newInjectedPage } from 'fingerprint-injector'; (async () => { const browser = await puppeteer.launch({ headless: false }); const page = await newInjectedPage(browser, { // constraints for the generated fingerprint fingerprintOptions: { devices: ['mobile'], operatingSystems: ['ios'], }, }); // ... your code using `page` here await page.goto('https://example.com'); })(); ``` -------------------------------- ### FingerprintGenerator Class Definition Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md Defines the FingerprintGenerator class, which extends HeaderGenerator. It includes a constructor for options and a method to get browser fingerprints with associated headers. ```typescript export class FingerprintGenerator extends HeaderGenerator { constructor(options: Partial = {}) getFingerprint( options: Partial = {}, requestDependentHeaders: Headers = {}, ): BrowserFingerprintWithHeaders } ``` -------------------------------- ### BayesianNetwork Constructor Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Creates a new Bayesian Network instance by loading a network definition from a zip file. The zip file must contain a network.json file with the network structure. ```APIDOC ## BayesianNetwork Constructor ### Description Creates a new Bayesian Network instance by loading a network definition from a zip file. The zip file must contain a network.json file with the network structure. ### Constructor Signature ```typescript constructor({ path }: { path: string }) ``` ### Parameters #### Path Parameters - **path** (string) - Required - Path to zip file containing network definition (network.json) ### Request Example ```typescript import { BayesianNetwork } from 'generative-bayesian-network'; const network = new BayesianNetwork({ path: '/path/to/network-definition.zip', }); ``` ``` -------------------------------- ### ExtraProperties Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/types.md Contains additional navigator properties that go beyond the standard API, such as vendor flavors, Bluetooth support, PDF viewer enablement, and installed applications. ```APIDOC ## ExtraProperties ### Description Additional navigator properties beyond the standard API. ### Properties - **vendorFlavors** (`string[]`) - navigator.vendorFlavors - **isBluetoothSupported** (`boolean`) - Bluetooth API support - **globalPrivacyControl** (`null`) - navigator.globalPrivacyControl - **pdfViewerEnabled** (`boolean`) - PDF viewer support - **installedApps** (`any[]`) - navigator.installedApps ``` -------------------------------- ### Project Directory Structure Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/INDEX.md This snippet displays the typical directory structure of the fingerprint-suite project, indicating the purpose of each main file and subdirectory. ```bash output/ ├── README.md # Project overview & quick start ├── INDEX.md # This file - documentation index ├── EXPORTS.md # Complete export reference ├── Types.md # Type definitions and interfaces ├── Configuration.md # Configuration options & defaults ├── Errors.md # Error conditions & troubleshooting └── api-reference/ # API reference by module ├── fingerprint-injector.md # Injection API ├── fingerprint-generator.md # Fingerprint generation API ├── header-generator.md # Header generation API └── bayesian-network.md # Network engine API ``` -------------------------------- ### Get Constraint Closure Utility Function Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md Calculates the constraint closure for a Bayesian network given possible values. This is useful for determining valid value combinations. ```typescript export function getConstraintClosure( network: BayesianNetwork, possibleValues: Record, ): Record ``` -------------------------------- ### Importing utils Namespace Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md Demonstrates how to import the entire 'utils' namespace, which contains various utility functions for array manipulation and constraint management. ```typescript export * as utils from './utils' ``` -------------------------------- ### Instantiate FingerprintGenerator with Options Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/fingerprint-generator.md Create a new FingerprintGenerator instance with custom options for devices, operating systems, screen dimensions, and WebRTC mocking. ```typescript import { FingerprintGenerator } from 'fingerprint-generator'; const generator = new FingerprintGenerator({ devices: ['mobile'], operatingSystems: ['ios'], screen: { minWidth: 320, maxWidth: 768, minHeight: 640, maxHeight: 1024, }, mockWebRTC: true, slim: false, }); ``` -------------------------------- ### Fingerprint Suite Project Structure Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md Illustrates the hierarchical organization of the fingerprint-suite project, showing the 'packages' directory and the subdirectories for each module. ```tree fingerprint-suite/ ├── packages/ │ ├── fingerprint-injector/ │ │ ├── src/ │ │ │ ├── fingerprint-injector.ts (main class and exports) │ │ │ ├── constants.ts │ │ │ └── utils.js (injected into browser) │ │ └── dist/ (compiled JavaScript) │ ├── fingerprint-generator/ │ │ ├── src/ │ │ │ ├── fingerprint-generator.ts (main class) │ │ │ ├── constants.ts │ │ │ └── data_files/ (Bayesian network definitions) │ │ └── dist/ │ ├── header-generator/ │ │ ├── src/ │ │ │ ├── header-generator.ts (main class) │ │ │ ├── constants.ts │ │ │ ├── utils.ts (helper functions) │ │ │ ├── presets.ts (browser presets) │ │ │ └── data_files/ (network definitions, header order) │ │ └── dist/ │ └── generative-bayesian-network/ │ ├── src/ │ │ ├── bayesian-network.ts (main class) │ │ ├── bayesian-node.ts (node class) │ │ └── utils.ts (utilities) │ └── dist/ └── README.md ``` -------------------------------- ### HeaderGenerator Class Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md The HeaderGenerator class is the main entry point for generating HTTP headers. It can be instantiated with options to customize header generation and provides methods to get and order headers. ```APIDOC ## Class: HeaderGenerator ### Description Provides methods to generate and manipulate HTTP headers. ### Methods #### constructor(options: Partial = {}) Initializes a new instance of the HeaderGenerator class. #### getHeaders(options: Partial = {}, requestDependentHeaders: Headers = {}, userAgentValues?: string[]): Headers Generates a set of HTTP headers based on the provided options and request-dependent headers. #### orderHeaders(headers: Headers, order?: string[]): Headers Orders the given headers according to the specified order. ### Protected/Private Methods #### prepareHttpBrowserObject(httpBrowserString: string): HttpBrowserObject Prepares an HttpBrowserObject from a string. #### prepareBrowserObject(browserString: string): HttpBrowserObject Prepares a browser object from a string. ``` -------------------------------- ### Valid Device/OS Combination for Header Generation Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Presents a valid combination of operating systems and device types for successful header generation. ```typescript // Valid const headers = generator.getHeaders({ operatingSystems: ['android', 'ios'], devices: ['mobile'], }); ``` -------------------------------- ### Initialize FingerprintGenerator with Default Options Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Set default browser, OS, device, locale, and screen constraints when creating a new FingerprintGenerator instance. ```typescript const generator = new FingerprintGenerator({ // Browser options browsers: ['chrome', 'firefox'], operatingSystems: ['windows', 'macos'], devices: ['desktop'], locales: ['en-US', 'de-DE'], httpVersion: '2', // Fingerprint-specific options screen: { minWidth: 1024, maxWidth: 2560, minHeight: 768, maxHeight: 1440, }, mockWebRTC: true, slim: false, // Advanced strict: false, }); ``` -------------------------------- ### BayesianNetwork Class Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/INDEX.md Documentation for the BayesianNetwork class, including its constructor and methods for generating samples and setting probabilities. ```APIDOC ## BayesianNetwork Class ### Description Implements a Bayesian network engine for probabilistic modeling. ### Constructor `new BayesianNetwork()` Initializes a new Bayesian network. ### Methods #### `generateSample()` Generates a random sample from the network. #### `generateConsistentSampleWhenPossible()` Generates a sample that is consistent with any specified constraints. #### `setProbabilitiesAccordingToData(data)` Sets the network's probabilities based on provided data. #### `saveNetworkDefinition()` Saves the current definition of the network. ``` -------------------------------- ### Get Constraint Closure for Bayesian Network Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Computes induced constraints from specified constraints and network structure. Use this to determine possible values for nodes based on existing constraints and the network's conditional probability tree structure. It performs DFS on the tree and implements constraint propagation. ```typescript import { utils } from 'generative-bayesian-network'; const constraints = utils.getConstraintClosure(network, { 'os': ['windows', 'linux'], 'device': ['desktop'], }); // Returns: { // 'os': ['windows', 'linux'], // 'device': ['desktop'], // 'browser': [...filtered possibilities...], // ... // } ``` -------------------------------- ### Valid Browser/OS Combination for Header Generation Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Shows a valid combination of browser and operating system for successful header generation. ```typescript // Valid combinations const headers = generator.getHeaders({ browsers: ['chrome'], operatingSystems: ['windows'], }); ``` -------------------------------- ### Generate Sample with Multiple Possibilities Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Generate a sample where nodes can have multiple possible values specified. ```javascript let consistentSample = generatorNetwork.generateSample({ ParentNode: ['A', 'B'], ChildNode: [',', '!'], }); ``` -------------------------------- ### Instantiate HeaderGenerator with Options Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/header-generator.md Create a new HeaderGenerator instance with custom options for browsers, operating systems, devices, locales, and HTTP version. ```typescript import { HeaderGenerator } from 'header-generator'; const generator = new HeaderGenerator({ browsers: ['chrome', 'firefox'], operatingSystems: ['windows', 'macos'], devices: ['desktop'], locales: ['en-US', 'en-GB'], httpVersion: '2', }); ``` -------------------------------- ### Instantiate BayesianNetwork Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Create an instance of the BayesianNetwork class using a provided network definition object. ```javascript let generatorNetwork = new BayesianNetwork(networkDefinition); ``` -------------------------------- ### Generate Browser Fingerprint and Headers Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/00-START-HERE.md Initialize `FingerprintGenerator` to create realistic browser fingerprints and matching HTTP headers. Specify device types and operating systems for generation. ```typescript import { FingerprintGenerator } from 'fingerprint-generator'; const gen = new FingerprintGenerator({ devices: ['mobile'], operatingSystems: ['ios'], mockWebRTC: true, }); const { fingerprint, headers } = gen.getFingerprint(); ``` -------------------------------- ### Configure HeaderGenerator with BrowsersList Query Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Employ this snippet to leverage BrowsersList syntax for sophisticated browser selection, overriding the 'browsers' option. This allows for dynamic selection based on market share, recency, or specific browser names. ```typescript const generator = new HeaderGenerator({ // Last 2 versions of each browser browserListQuery: 'last 2 versions', }); ``` ```typescript const generator2 = new HeaderGenerator({ // Browsers used by >1% of users browserListQuery: '> 1%', }); ``` ```typescript const generator3 = new HeaderGenerator({ // Chrome and Firefox from last year browserListQuery: 'last 1 year, chrome, firefox', }); ``` -------------------------------- ### Valid HeaderGenerator Options Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Shows the correct way to instantiate HeaderGenerator with valid options for browsers, operating systems, devices, locales, HTTP version, and strict mode. ```typescript // Valid options const generator = new HeaderGenerator({ browsers: ['chrome', 'firefox'], // Valid names operatingSystems: ['windows', 'macos'], devices: ['desktop', 'mobile'], // Valid devices locales: ['en-US', 'en-GB', 'de-DE'], // Max 10 httpVersion: '2', // '1' or '2' only strict: false, // boolean only }); ``` -------------------------------- ### Generate Sample from Bayesian Network Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/00-START-HERE.md Instantiate `BayesianNetwork` with a path to a network definition file. Use the network to generate a sample from the defined probabilistic model. ```typescript import { BayesianNetwork } from 'generative-bayesian-network'; const network = new BayesianNetwork({ path: '/path/to/network-definition.zip', }); const sample = network.generateSample(); ``` -------------------------------- ### Error Message: No headers can be generated Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md This error occurs when the input parameters for header generation are impossible to satisfy. It requires adjusting browser/OS compatibility, versions, locales, or device/OS combinations. ```text Error: No headers based on this input can be generated. Please relax or change some of the requirements you specified. ``` -------------------------------- ### HeaderGenerator Constructor Source: https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/README.md Initializes a new HeaderGenerator instance. The options provided here serve as default settings for subsequent header generation calls, unless overridden. ```APIDOC ## `new HeaderGenerator(options)` ### Description Initializes a new HeaderGenerator instance with default options. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **options** (`HeaderGeneratorOptions`) - Optional - default header generation options used unless overridden ``` -------------------------------- ### Using Realistic Browser Versions for Fingerprint Generation Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Fingerprint generation can fail if unrealistic browser versions are specified. This snippet demonstrates how to switch from an improbable `minVersion` to a realistic one for a given browser. ```typescript const fp = generator.getFingerprint({ browsers: [{ name: 'safari', minVersion: 500 }] // Unrealistic }); // Use realistic versions const fp = generator.getFingerprint({ browsers: [{ name: 'safari', minVersion: 14 }] }); ``` -------------------------------- ### generateConsistentSampleWhenPossible Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Generates a random sample that respects constraints on which values are possible for each node. Returns an empty object if no consistent sample can be generated. This method is more expensive than `generateSample` due to backtracking. ```APIDOC ## generateConsistentSampleWhenPossible ### Description Generates a random sample that respects constraints on which values are possible for each node. Returns an empty object if no consistent sample can be generated. ### Method `generateConsistentSampleWhenPossible(valuePossibilities: Record): Record` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **valuePossibilities** (`Record`) - Required - Dict mapping node names to arrays of possible values. ### Returns `Record` - Sample respecting constraints, or empty object if impossible. ### Example ```typescript const network = new BayesianNetwork({ path: '/path/to/network.zip', }); const sample = network.generateConsistentSampleWhenPossible({ 'browser': ['chrome', 'firefox'], 'deviceType': ['mobile'], 'os': ['ios', 'android'], }); if (Object.keys(sample).length === 0) { console.log('No sample could be generated with these constraints'); } else { console.log('Generated consistent sample:', sample); } ``` ``` -------------------------------- ### Configure Specific Browser Versions and HTTP Version Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Use BrowserSpecification objects to define precise browser names, minimum/maximum versions, and HTTP versions for fingerprint generation. ```typescript const generator = new FingerprintGenerator({ browsers: [ 'chrome', // Any version { name: 'firefox', minVersion: 95 }, // Firefox 95+ { name: 'safari', minVersion: 14, maxVersion: 16 }, // Safari 14-16 { name: 'edge', minVersion: 100, httpVersion: '1' }, // Edge 100+ with HTTP/1.1 ], }); ``` -------------------------------- ### BayesianNetwork Constructor Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Initializes a new BayesianNetwork instance. The network structure and its probability distributions are defined by the provided networkDefinition object. ```APIDOC ## new BayesianNetwork(networkDefinition) ### Description Initializes a new BayesianNetwork instance. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **networkDefinition** (object) - Required - object defining the network structure and distributions ### Request Example ```json { "networkDefinition": { ... } } ``` ### Response #### Success Response (200) * **BayesianNetwork** - The newly created BayesianNetwork instance. #### Response Example ```json { "message": "BayesianNetwork created successfully" } ``` ``` -------------------------------- ### Configure Realistic Screen Constraints Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Avoid overly restrictive screen dimensions to allow the generator to produce more realistic combinations. This snippet shows how to set minimum and maximum width and height for screen properties. ```typescript // Don't use overly restrictive screen constraints const generator = new FingerprintGenerator({ screen: { minWidth: 1024, maxWidth: 2560, minHeight: 768, maxHeight: 1440, } }); // Let the Bayesian network generate realistic combinations const fp = generator.getFingerprint(); ``` -------------------------------- ### Configure for Mobile iOS Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/00-START-HERE.md Use this configuration to generate fingerprints for mobile Safari browsers on iOS devices. Includes mock WebRTC. ```typescript new FingerprintGenerator({ browsers: ['safari'], operatingSystems: ['ios'], devices: ['mobile'], mockWebRTC: true, }); ``` -------------------------------- ### Configure FingerprintGenerator for Fast Generation Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Optimize fingerprint generation speed by enabling the 'slim' option, which disables some evasions. This is suitable when screen constraints are not required. ```typescript // Fast generation const fastGen = new FingerprintGenerator({ slim: true, // Disable some evasions // Don't use screen constraints }); ``` -------------------------------- ### Import FingerprintGenerator Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/fingerprint-generator.md Import the FingerprintGenerator class from the 'fingerprint-generator' module. ```typescript import { FingerprintGenerator } from 'fingerprint-generator'; ``` -------------------------------- ### Import BayesianNetwork Class Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Import the BayesianNetwork class from the 'generative-bayesian-network' module. ```typescript import { BayesianNetwork } from 'generative-bayesian-network'; ``` -------------------------------- ### Accessing Nodes by Name Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/bayesian-network.md Demonstrates how to retrieve a specific node from the network using its name and access its possible values. ```typescript const node = network.nodesByName['browser']; console.log(node.possibleValues); // ['chrome', 'firefox', 'safari', ...] ``` -------------------------------- ### FingerprintGenerator Constructor Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/fingerprint-generator.md Initializes a new FingerprintGenerator instance. You can provide options to customize the default fingerprint and header generation, including screen dimensions, WebRTC mocking, slim mode, browser and OS specifications, device types, locales, and HTTP version. ```APIDOC ## FingerprintGenerator Constructor ### Description Creates a new `FingerprintGenerator` instance with optional default options. ### Signature ```typescript constructor(options: Partial = {}) ``` ### Parameters #### Options - **options** (`Partial`) - Optional - Default: `{}` - Default fingerprint and header generation options. - **options.screen** (`{minWidth?, maxWidth?, minHeight?, maxHeight?}`) - Optional - Screen dimension constraints. - **options.mockWebRTC** (`boolean`) - Optional - Default: `false` - Enable WebRTC mocking. - **options.slim** (`boolean`) - Optional - Default: `false` - Enable slim mode (disables some performance-heavy evasions). - **options.browsers** (`BrowsersType`) - Optional - Default: All supported - Browser specifications. - **options.operatingSystems** (`OperatingSystem[]`) - Optional - Default: All supported - Operating systems. - **options.devices** (`Device[]`) - Optional - Default: `['desktop']` - Device types. - **options.locales** (`string[]`) - Optional - Default: `['en-US']` - Languages for headers. - **options.httpVersion** (`HttpVersion`) - Optional - Default: `'2'` - HTTP version (1 or 2). - **options.browserListQuery** (`string`) - Optional - BrowsersList query string. - **options.strict** (`boolean`) - Optional - Default: `false` - Throw error if generation fails. ### Example ```typescript import { FingerprintGenerator } from 'fingerprint-generator'; const generator = new FingerprintGenerator({ devices: ['mobile'], operatingSystems: ['ios'], screen: { minWidth: 320, maxWidth: 768, minHeight: 640, maxHeight: 1024, }, mockWebRTC: true, slim: false, }); ``` ``` -------------------------------- ### generateSample Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Generates a random sample from the network. Optionally, you can provide known values for certain nodes to condition the sampling. ```APIDOC ## generateSample ### Description Generates a random sample of node values from the Bayesian network. Can be conditioned on known node values. ### Parameters #### Parameters - **knownValues** (object) - Optional - An object where keys are node names and values are the known values for those nodes. ``` -------------------------------- ### BrowserSpecification Source: https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/README.md Defines a specific browser configuration for header generation, including name, version range, and HTTP version. ```APIDOC ## BrowserSpecification ### Description Defines a specific browser configuration for header generation, including name, version range, and HTTP version. ### Parameters #### Required Parameters - **name** (string) - The name of the browser. Must be one of 'chrome', 'firefox', or 'safari'. - **minVersion** (number) - The minimum version of the browser to use. - **maxVersion** (number) - The maximum version of the browser to use. #### Optional Parameters - **httpVersion** (string) - The HTTP version to be used for generating headers. Can be '1' or '2'. If not specified, the `httpVersion` from `HeaderGeneratorOptions` is used. ``` -------------------------------- ### Initialize HeaderGenerator with Constructor Options Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Use this snippet to set specific browser, OS, device, locale, and HTTP version preferences when creating a HeaderGenerator instance. The 'strict' option controls error handling. ```typescript const generator = new HeaderGenerator({ browsers: ['chrome', 'firefox', 'safari'], operatingSystems: ['windows', 'macos'], devices: ['desktop', 'mobile'], locales: ['en-US', 'en-GB', 'de-DE'], httpVersion: '2', strict: false, }); ``` -------------------------------- ### Configure FingerprintGenerator with Screen Constraints Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/configuration.md Configure the FingerprintGenerator to use specific screen dimensions. Enable 'slim' mode to compensate for the performance impact of screen constraints. ```typescript // When screen constraints are needed const constrainedGen = new FingerprintGenerator({ screen: { minWidth: 320, maxWidth: 1920, minHeight: 480, maxHeight: 1080, }, slim: true, // Compensate with slim mode }); ``` -------------------------------- ### SUPPORTED_OPERATING_SYSTEMS Constant Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md An array constant listing the supported operating system names. Used for type definitions and validation. ```typescript const SUPPORTED_OPERATING_SYSTEMS = [ 'windows', 'macos', 'linux', 'android', 'ios', ] as const ``` -------------------------------- ### getHeaders Method Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/header-generator.md Generates a single set of realistic HTTP headers based on specified constraints, optionally overriding default options and merging request-specific headers. ```APIDOC ## getHeaders Method ### Description Generates a single set of realistic HTTP headers based on specified constraints. It can override default options and merge request-dependent headers. ### Signature ```typescript getHeaders( options: Partial = {}, requestDependentHeaders: Headers = {}, userAgentValues?: string[], ): Headers ``` ### Parameters #### Options - **options** (`Partial`) - Optional - Override default options for this call. - **requestDependentHeaders** (`Headers`) - Optional - Headers that are request-specific (merged into result). - **userAgentValues** (`string[]`) - Optional - Pre-specified user-agent values to constrain by. ### Returns - `Headers` - Object mapping header names to values. ### Throws - `Error` - If headers cannot be generated and strict mode is enabled. ### Notes - If generation fails and strict mode is disabled, relaxes requirements and retries. - Headers are ordered based on the user-agent's browser type. - HTTP/1 headers use Title-Case; HTTP/2 uses lowercase. - SEC-CH-UA headers are omitted for non-Chromium browsers. - Returns properly ordered headers matching real browser behavior. ### Example ```typescript const generator = new HeaderGenerator({ browsers: ['chrome'], devices: ['mobile'], locales: ['en-US'], }); const headers = generator.getHeaders(); console.log(headers); // With request-dependent headers const headersWithAccept = generator.getHeaders( { operatingSystems: ['windows'] }, { 'Accept': 'application/json' } ); ``` ``` -------------------------------- ### orderHeaders Method Source: https://github.com/apify/fingerprint-suite/blob/master/packages/header-generator/README.md Returns a new object with headers ordered according to a specified sequence. If no order is provided, it attempts to deduce the order from the User-Agent header. ```APIDOC ## `headerGenerator.orderHeaders(headers, order)` ### Description Returns a new object that contains ordered headers. ### Method GET (or relevant method for SDK) ### Endpoint N/A (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters - **headers** (`object`) - Required - specifies known values of headers dependent on the particular request - **order** (`string[]?`) - Optional - an array of ordered header names, optional (will be deducted from `user-agent`) ``` -------------------------------- ### generateConsistentSampleWhenPossible Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Generates a random sample that is consistent with the provided possible values for nodes. This method attempts to find a sample that satisfies multiple potential values for given nodes. ```APIDOC ## generateConsistentSampleWhenPossible ### Description Generates a random sample that is consistent with the provided possible values for nodes, if possible. This method allows for multiple potential values for each conditioned node. ### Parameters #### Parameters - **possibleValues** (object) - Optional - An object where keys are node names and values are arrays of possible values for those nodes. ``` -------------------------------- ### BrowserFingerprintWithHeaders Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/types.md Combines the generated browser fingerprint with HTTP headers that are consistent with the fingerprint, useful for request simulation. ```APIDOC ## BrowserFingerprintWithHeaders ### Description Combined fingerprint and header generation result. ### Properties - **headers** (`Headers`) - Generated HTTP headers consistent with fingerprint - **fingerprint** (`Fingerprint`) - Generated browser fingerprint ``` -------------------------------- ### Configure for Mobile Android Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/00-START-HERE.md Use this configuration to generate fingerprints for mobile Chrome browsers on Android devices. Includes mock WebRTC. ```typescript new FingerprintGenerator({ browsers: ['chrome'], operatingSystems: ['android'], devices: ['mobile'], mockWebRTC: true, }); ``` -------------------------------- ### Configure for Desktop Chrome Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/00-START-HERE.md Use this configuration to generate fingerprints for desktop Chrome browsers on Windows, macOS, or Linux. ```typescript new FingerprintGenerator({ browsers: ['chrome'], operatingSystems: ['windows', 'macos', 'linux'], devices: ['desktop'], }); ``` -------------------------------- ### Triggering Header Generation Error: Invalid Device/OS Combination Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Demonstrates an invalid combination of operating system and device type that leads to a header generation error. Ensure valid OS/device pairings for successful generation. ```typescript // Invalid - Windows mobile doesn't exist const headers = generator.getHeaders({ operatingSystems: ['windows'], devices: ['mobile'], }); ``` -------------------------------- ### BayesianNetwork Constructor Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Initializes a new BayesianNetwork instance. The constructor accepts a JSON object that defines the network structure and optionally the conditional probabilities for each node. ```APIDOC ## BayesianNetwork Constructor ### Description Initializes a new BayesianNetwork instance with a given network definition. ### Parameters #### Parameters - **networkDefinition** (object) - Required - A JSON object defining the network structure and probabilities. ``` -------------------------------- ### Configure Default Fingerprint Generator Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/00-START-HERE.md Initializes the FingerprintGenerator with default settings, covering all supported browsers. ```typescript new FingerprintGenerator(); ``` -------------------------------- ### Import FingerprintInjector Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/fingerprint-injector.md Import the FingerprintInjector class from the 'fingerprint-injector' package. ```typescript import { FingerprintInjector } from 'fingerprint-injector'; ``` -------------------------------- ### Enable Verbose Logging for Errors Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Use a try-catch block to capture and log detailed error messages, including the message and stack trace, when fingerprint generation fails. This is useful for diagnosing issues with specific browser or OS configurations. ```typescript import { FingerprintGenerator } from 'fingerprint-generator'; const gen = new FingerprintGenerator({ strict: true }); try { const fp = gen.getFingerprint({ browsers: [{ name: 'safari', minVersion: 500 }], operatingSystems: ['windows'], }); } catch (error) { console.error('Fingerprint generation failed:'); console.error(error.message); console.error(error.stack); } ``` -------------------------------- ### Correct FingerprintInjector Usage with Playwright Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Demonstrates the correct order of operations for attaching a fingerprint to a Playwright context. Ensure the context is created and initialized before attaching the fingerprint. ```typescript const browser = await chromium.launch(); const context = await browser.newContext(); // Create first const injector = new FingerprintInjector(); await injector.attachFingerprintToPlaywright(context, fingerprint); // After this point context is safe to use const page = await context.newPage(); ``` -------------------------------- ### FingerprintGeneratorOptions Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/fingerprint-generator.md Options for configuring the fingerprint generator, extending HeaderGeneratorOptions with screen constraints and mode settings. ```APIDOC ### FingerprintGeneratorOptions Extends `HeaderGeneratorOptions` with additional properties: ```typescript interface FingerprintGeneratorOptions extends HeaderGeneratorOptions { screen?: { minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number; }; mockWebRTC?: boolean; slim?: boolean; } ``` | Option | Type | Default | Description | |----------|------|---------|-------------| | screen | `object` | — | Screen dimension constraints | | mockWebRTC | `boolean` | `false` | Mock WebRTC to prevent IP leak | | slim | `boolean` | `false` | Enable slim mode for faster generation | ``` -------------------------------- ### Save Network Definition Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Save the current network's definition to a specified file path. ```javascript generatorNetwork.saveNetworkDefinition(networkDefinitionFilePath); ``` -------------------------------- ### Avoid Screen Constraints for Performance Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/README.md Screen constraints significantly slow down fingerprint generation. Avoid them when possible for faster results. ```typescript // Slow const fp = gen.getFingerprint({ screen: { minWidth: 1024, maxWidth: 2560 } }); // Fast (no constraint) const fp = gen.getFingerprint(); ``` -------------------------------- ### VideoCard Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/types.md Provides GPU information extracted from the WebGL context, including the renderer and vendor details. ```APIDOC ## VideoCard ### Description GPU information extracted from WebGL context. ### Properties - **renderer** (`string`) - WebGL UNMASKED_RENDERER_WEBGL parameter - **vendor** (`string`) - WebGL UNMASKED_VENDOR_WEBGL parameter ### Example ```typescript const fingerprint = generator.getFingerprint(); console.log(fingerprint.fingerprint.videoCard); // { vendor: "Google Inc.", renderer: "ANGLE (Intel HD Graphics)" } ``` ``` -------------------------------- ### BrowserSpecification Interface Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md Defines the specification for a browser, including its name, version range, and HTTP version support. ```APIDOC ## Interface: BrowserSpecification ### Description Represents the specification for a browser. ### Properties - **name** (BrowserName) - Required - The name of the browser. - **minVersion** (number) - Optional - The minimum version of the browser. - **maxVersion** (number) - Optional - The maximum version of the browser. - **httpVersion** (HttpVersion) - Optional - The supported HTTP version. ``` -------------------------------- ### getFingerprint Method Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/fingerprint-generator.md Generates a realistic browser fingerprint and matching HTTP headers. It uses a Bayesian network to ensure consistency and can be customized with options to override defaults or include request-dependent headers. ```APIDOC ## getFingerprint Method ### Description Generates a realistic browser fingerprint and matching HTTP headers using a Bayesian network to ensure consistency. ### Signature ```typescript getFingerprint( options: Partial = {}, requestDependentHeaders: Headers = {} ): BrowserFingerprintWithHeaders ``` ### Parameters #### options - **options** (`Partial`) - Optional - Default: `{}` - Override default generator options. #### requestDependentHeaders - **requestDependentHeaders** (`Headers`) - Optional - Default: `{}` - Pre-known headers specific to the request (e.g., Accept, Accept-Encoding). ### Returns - **BrowserFingerprintWithHeaders** - An object containing: - **fingerprint** (`Fingerprint`) - The generated fingerprint. - **headers** (`Headers`) - The generated HTTP headers. ### Notes - The method retries up to 10 times to generate a valid fingerprint. - Throws an error if no valid fingerprint can be generated after 10 attempts. - Screen dimension constraints may reduce generation performance (~30x slower). - If strict mode is disabled, requirements are relaxed if generation fails. ### Example ```typescript const generator = new FingerprintGenerator(); // Generate a random fingerprint const fp1 = generator.getFingerprint(); // Generate with specific constraints const fp2 = generator.getFingerprint({ browsers: [{ name: 'chrome', minVersion: 100 }], devices: ['mobile'], }); // With request-dependent headers const fp3 = generator.getFingerprint( { operatingSystems: ['windows'] }, { 'Accept': 'text/html' } ); console.log(fp1.fingerprint.navigator.userAgent); console.log(fp1.headers['user-agent']); ``` ``` -------------------------------- ### generateConsistentSampleWhenPossible Source: https://github.com/apify/fingerprint-suite/blob/master/packages/generative-bayesian-network/README.md Generates a sample from the bayesian network that is consistent with specified value possibilities for certain nodes. Returns false if no consistent sample can be generated. ```APIDOC ## bayesianNetwork.generateConsistentSampleWhenPossible(valuePossibilities) ### Description Randomly samples from the distribution represented by the bayesian network, making sure the sample is consistent with the provided restrictions on value possibilities. Returns false if no such sample can be generated. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **valuePossibilities** (object) - Required - a dictionary of lists of possible values for nodes (if a node isn't present in the dictionary, all values are possible) ### Request Example ```json { "valuePossibilities": { "node1": ["valueA", "valueB"] } } ``` ### Response #### Success Response (200) * **sample** (object | boolean) - A consistent sample from the network distribution, or false if no consistent sample can be generated. #### Response Example ```json { "sample": { "node1": "valueA", "node2": "valueC" } } ``` ``` -------------------------------- ### SUPPORTED_DEVICES Constant Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md An array constant listing the supported device types. Used for type definitions and validation. ```typescript const SUPPORTED_DEVICES = ['desktop', 'mobile'] as const ``` -------------------------------- ### Generate Realistic HTTP Headers Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/00-START-HERE.md Use `HeaderGenerator` to produce HTTP headers that mimic real browser patterns. Configure the desired browsers and device types for header generation. ```typescript import { HeaderGenerator } from 'header-generator'; const gen = new HeaderGenerator({ browsers: ['chrome', 'firefox'], devices: ['desktop', 'mobile'], }); const headers = gen.getHeaders(); ``` -------------------------------- ### CommonJS Imports Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/EXPORTS.md Use `require()` to import modules in a CommonJS environment. ```javascript const { FingerprintGenerator } = require('fingerprint-generator'); const { HeaderGenerator } = require('header-generator'); const { FingerprintInjector, newInjectedPage } = require('fingerprint-injector'); const { BayesianNetwork, utils } = require('generative-bayesian-network'); ``` -------------------------------- ### Triggering Header Generation Error: Invalid Browser/OS Combination Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/errors.md Demonstrates an invalid browser and operating system combination that triggers a header generation error. Use valid combinations for successful generation. ```typescript // Invalid - Safari doesn't run on Windows try { const headers = generator.getHeaders({ browsers: ['safari'], operatingSystems: ['windows'], }); } catch (e) { console.error(e.message); } ``` -------------------------------- ### BrowserSpecification Interface Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/types.md Specifies a browser with optional version constraints. Use this to target specific browser versions or HTTP versions. ```typescript interface BrowserSpecification { name: BrowserName; minVersion?: number; maxVersion?: number; httpVersion?: HttpVersion; } ``` ```typescript const specs: BrowserSpecification[] = [ { name: 'chrome', minVersion: 100 }, { name: 'firefox', minVersion: 95, maxVersion: 110 }, ]; ``` -------------------------------- ### HTTP/1 SEC-Fetch Attributes Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/types.md Defines an object mapping SEC-Fetch attribute names to their Title-Case HTTP/1 header keys. Use this for generating HTTP/1 headers. ```typescript const HTTP1_SEC_FETCH_ATTRIBUTES = { mode: 'Sec-Fetch-Mode', dest: 'Sec-Fetch-Dest', site: 'Sec-Fetch-Site', user: 'Sec-Fetch-User', } as const ``` -------------------------------- ### Device Type Alias Source: https://github.com/apify/fingerprint-suite/blob/master/_autodocs/api-reference/header-generator.md Defines the allowed device types for header generation. Supports 'desktop' and 'mobile'. ```typescript type Device = 'desktop' | 'mobile'; ```