Search by

jooservices / useragent

jooservices

Deterministic, dataset-backed synthetic User-Agent profiles for tests and fixtures.

Package info

github.com/jooservices/useragent

pkg:composer/jooservices/useragent

Statistics

Installs: 409

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 2

v4.0.0 2026-09-09 17:17 UTC

This package is auto-updated.

Last update: 2026-09-21 09:31:21 UTC


README

CI OpenSSF Scorecard PHP Version GitHub Release License: MIT

PHP 8.5+ deterministic generator of coherent synthetic browser User-Agent profiles for tests, fixtures, and controlled client configuration.

Features

  • Checksummed bundled dataset with provenance on every result
  • Seeded, weighted, uniform, and round-robin profile selection
  • Immutable fluent request builder and bounded unique batch generation
  • generatePool() for a list of ready-to-use User-Agent strings
  • Stable profile identity for logs and fixtures
  • Non-interactive CLI with JSON and NDJSON output

Requirements

  • PHP >= 8.5
  • ext-json
  • jooservices/dto ^3.0

Installation

composer require jooservices/useragent:^4.0

Quick start

use JOOservices\UserAgent\Generator;

$generator = Generator::create();
$pool = $generator->builder()
    ->chrome()
    ->windows()
    ->desktop()
    ->seed(42)
    ->generatePool(10);

Design notes

  • Reuse one Generator instance in long-running processes; it loads and validates the bundled dataset once.
  • A User-Agent string is synthetic metadata, not browser emulation.
  • The package performs no network access and does not accept a caller-provided dataset path.

Documentation

Development

make build
make install
make lint
make test
make ci

Community

License

MIT — see LICENSE.