Skip to content

client-parser

A tiny, type-safe client classifier with User-Agent, Client Hints, and HTTP header support.

A tiny, type-safe client classifier with User-Agent, Client Hints, and HTTP header support.

What it is

A small, type-safe library that classifies the browser, OS, device, and bot behind a request from User-Agent strings, Client Hints, and HTTP headers.

The problem

Analytics and diagnostics need a normalized view of which browser, OS, device, or bot made a request. The raw User-Agent string can be changed by any client, and many parsers are heavy or quietly encourage using the result for decisions it cannot support.

What it delivers

  • Consumers can classify common client strings.
  • Results are enriched with Client Hints when they are available.
  • Analytics and presentation code can distinguish bots, devices, and browsers.
  • Developers can inspect parsing behavior in the playground without sending their input anywhere.

Limits to know

  • User-Agent classification is heuristic, and any client can spoof it.
  • Client Hints availability varies and may be restricted for privacy.
  • Results cannot safely drive authentication, authorization, or capability decisions.

Status and role

  • Status: Pre-1.0 package
  • My role: Library design and package engineering
  • Scope: Typed APIs, compatibility, and package distribution

Project stack

  • TypeScript
  • ESM
  • CommonJS
  • tsup
  • TanStack Start
  • React
  • Tailwind CSS
  • Vite
  • Vitest
  • Netlify
  • GitHub Actions
  • CI/CD

Need help with this project? Get project support

Working through something similar?

Share your challenge, scope, and timeline to start a focused conversation.

Discuss a project