{"id":22007029,"url":"https://github.com/userquin/http-client-hints","last_synced_at":"2025-07-16T12:09:29.612Z","repository":{"id":259867005,"uuid":"879692659","full_name":"userquin/http-client-hints","owner":"userquin","description":"HTTP Client Hints","archived":false,"fork":false,"pushed_at":"2024-10-28T20:20:30.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T00:24:31.292Z","etag":null,"topics":["detect-browser","detect-operating-system","device-hints","network-hints","user-agent-client-hints"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/userquin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-28T11:37:45.000Z","updated_at":"2024-10-30T00:25:57.000Z","dependencies_parsed_at":"2024-11-02T22:02:32.619Z","dependency_job_id":null,"html_url":"https://github.com/userquin/http-client-hints","commit_stats":null,"previous_names":["userquin/http-client-hints"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userquin%2Fhttp-client-hints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userquin%2Fhttp-client-hints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userquin%2Fhttp-client-hints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/userquin%2Fhttp-client-hints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/userquin","download_url":"https://codeload.github.com/userquin/http-client-hints/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252589747,"owners_count":21772926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["detect-browser","detect-operating-system","device-hints","network-hints","user-agent-client-hints"],"created_at":"2024-11-30T01:16:21.405Z","updated_at":"2025-05-05T22:41:29.180Z","avatar_url":"https://github.com/userquin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTTP Client Hints\n\n[![npm version][npm-version-src]][npm-version-href]\n[![npm downloads][npm-downloads-src]][npm-downloads-href]\n[![JSDocs][jsdocs-src]][jsdocs-href]\n[![License][license-src]][license-href]\n\nAccess and use HTTP Client Hints in your application. Detect the client browser and the operating system on your server.\n\n## Features\n\n- 🚀 Browser and Operating System detection: check [detect-browser-es](https://www.npmjs.com/package/detect-browser-es) for more information.\n- 💥 [Device Hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#client_hints) detection\n- ⚡ [Network Hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#client_hints) detection\n- ✨ [Critical Hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints#critical_client_hints) detection\n\n## HTTP Client hints\n\n\u003e [!WARNING]\n\u003e The [HTTP Client hints headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints) listed below are still in draft and only Chromium based browsers support them: Chrome, Edge, Chromium and Opera.\n\nThe module includes support for the following HTTP Client hints:\n- [Device Hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#client_hints)\n  - [Device-Memory](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Device-Memory)\n- [Network Hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#client_hints)\n  - [Save-Data](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Save-Data)\n  - [Downlink](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Downlink)\n  - [ECT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ECT)\n  - [RTT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/RTT)\n- [User Agent Hints](https://github.com/WICG/ua-client-hints)\n  - [Sec-CH](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH)\n  - [Sec-CH-UA](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA)\n  - [Sec-CH-UA-Mobile](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Mobile)\n  - [Sec-CH-UA-Platform](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform)\n  - [Sec-CH-UA-Arch](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Arch)\n  - [Sec-CH-UA-Model](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Model)\n  - [Sec-CH-UA-Platform-Version](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform-Version)\n  - [Sec-CH-UA-Bitness](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Bitness)\n- [Critical Client Hints](https://developer.mozilla.org/en-US/docs/Web/HTTP/Client_hints#critical_client_hints)\n  - [Sec-CH-Width](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Width)\n  - [Sec-CH-DPR](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-DPR)\n  - [Sec-CH-Viewport-Width](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Viewport-Width)\n  - [Sec-CH-Viewport-Height](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Viewport-Height)\n  - [Sec-CH-Prefers-Color-Scheme](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme)\n  - [Sec-CH-Prefers-Reduced-Motion](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion)\n  - [Sec-CH-Prefers-Reduced-Transparency](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Transparency)\n\n## Quick Setup\n\nInstall the package you want to use in your application, this package exports each client hint separately, or you can use the default to use all the hints.\n\n```js\nimport {\n  extractBrowserHints,\n  extractCriticalHints,\n  extractDeviceHints,\n  extractNetworkHints,\n} from 'http-client-hints'\n```\n\nor\n\n```js\nimport { extractBrowserHints } from 'http-client-hints/browser'\nimport { extractCriticalHints } from 'http-client-hints/critical'\nimport { extractDeviceHints } from 'http-client-hints/device'\nimport { extractNetworkHints } from 'http-client-hints/network'\n```\n\nYou can also use require (CommonJS: CJS), the package has been built with dual ESM and CJS support.\n\n```js\nconst {\n  extractBrowserHints,\n  extractCriticalHints,\n  extractDeviceHints,\n  extractNetworkHints,\n} = require('http-client-hints')\n```\n\nor\n\n```js\nconst { extractBrowserHints } = require('http-client-hints/browser')\nconst { extractCriticalHints } = require('http-client-hints/critical')\nconst { extractDeviceHints } = require('http-client-hints/device')\nconst { extractNetworkHints } = require('http-client-hints/network')\n```\n\nYou can also use this package when using [H3](https://github.com/unjs/h3/tree/main):\n\n```js\nimport { extractImageClientHints } from 'http-client-hints/h3'\n```\n\nIf you want to use this package in your [Nuxt](https://nuxtjs.org) application, check [Nuxt HTTP Client Hints Module](https://github.com/userquin/nuxt-http-client-hints).\n\nThat's it! You can now use HTTP Client Hints in your server application ✨\n\nYou can check the source code or the [JSDocs](https://www.jsdocs.io/package/http-client-hints) for more information.\n\n## License\n\n[MIT](./LICENSE) License © 2024-PRESENT [Joaquín Sánchez](https://github.com/userquin)\n\n\u003c!-- Badges --\u003e\n\n[npm-version-src]: https://img.shields.io/npm/v/http-client-hints?style=flat\u0026colorA=18181B\u0026colorB=F0DB4F\n[npm-version-href]: https://npmjs.com/package/http-client-hints\n[npm-downloads-src]: https://img.shields.io/npm/dm/http-client-hints?style=flat\u0026colorA=18181B\u0026colorB=F0DB4F\n[npm-downloads-href]: https://npmjs.com/package/http-client-hints\n[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat\u0026colorA=18181B\u0026colorB=F0DB4F\n[jsdocs-href]: https://www.jsdocs.io/package/http-client-hints\n[license-src]: https://img.shields.io/github/license/userquin/http-client-hints.svg?style=flat\u0026colorA=18181B\u0026colorB=F0DB4F\n[license-href]: https://github.com/userquin/http-client-hints/blob/main/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserquin%2Fhttp-client-hints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuserquin%2Fhttp-client-hints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuserquin%2Fhttp-client-hints/lists"}