How apify/fingerprint-suite works
Project Type and Purpose
• This is a modular monorepo (‘fingerprint-suite’) providing developer libraries and tools for browser fingerprint generation and injection. It is not a user-facing full-stack app but a collection of npm packages (and one Python package) that work together to:
• Collect real header orders (header-order-collector service)
• Generate Bayesian network definitions (generator-networks-creator)
• Generate network-based fingerprints (generative-bayesian-network)
• Create realistic HTTP headers (header-generator)
• Generate full browser fingerprint objects (fingerprint-generator)
• Inject those fingerprints into Playwright/Puppeteer browser contexts (fingerprint-injector)
File Structure Analysis
• Top-level: config files (.eslintrc, tsconfig, CI workflows), scripts/, static assets, test/
• packages/: each package is isolated with its own src/, data_files/, and build config; managed by Turborepo (turbo.json)
• apify_fingerprint_datapoints/: Python wrapper publishing typed data points
• packages/header-order-collector/: a standalone Node.js HTTP service (with Dockerfile and certs)
• scripts/: orchestration (data copying, network generation, publishing)
• test/: end-to-end and unit test suites for each package
README Insights
• Core use case: camouflage browser automation by generating & injecting realistic fingerprints
• Lists four primary npm packages plus the Bayesian network implementation
• Shows code snippets using Playwright or Puppeteer integration via fingerprint-injector
Main Components
a. Data Collection Service
• header-order-collector (Node.js HTTP server, Dockerized)
b. Network Definition Generation
• generator-networks-creator (reads raw data, outputs .zip network definitions)
c. Generative Model
• generative-bayesian-network (inputs definitions, outputs probabilistic fingerprint parameters)
d. Fingerprint Generation
• fingerprint-generator (wraps Bayesian network, outputs JSON fingerprint + HTTP headers blueprint)
e. HTTP Header Generation
• header-generator (takes fingerprint data to synthesize realistic headers)
f. Fingerprint Injection
• fingerprint-injector (Playwright/Puppeteer API hooks to inject fingerprint into browser contexts)
g. Python Data Points Package
• apify_fingerprint_datapoints (exports generated fingerprint types for Python users)
h. Orchestration & Scripts
• scripts/netgen.sh, .ts and copy.ts, publish.sh
Relationships and Data Flow
• generator-networks-creator → generative-bayesian-network (network definitions)
• generative-bayesian-network → fingerprint-generator (probabilistic fingerprint data)
• fingerprint-generator ↔ header-generator (fingerprint data used to craft headers)
• fingerprint-generator + header-generator → fingerprint-injector → Playwright/Puppeteer browser instance
• Scripts orchestrate generation pipeline and publishing to npm
• Python package imported by Python workflows
Architectural Patterns & Design Principles
• Monorepo with well-defined package boundaries
• Reusable libraries (single responsibility per package)
• Data-driven generation via Bayesian networks
• Service for data collection (header-order-collector) separated from offline generation
• CI/CD via GitHub Actions and Turborepo caching