{"id":16594609,"url":"https://github.com/antonybudianto/react-client-hints","last_synced_at":"2025-03-21T13:31:51.612Z","repository":{"id":40768228,"uuid":"264257755","full_name":"antonybudianto/react-client-hints","owner":"antonybudianto","description":"React User Agent Client Hints Hooks, Component, and Provider. SSR-ready and fully unit-tested.","archived":false,"fork":false,"pushed_at":"2023-01-06T06:00:42.000Z","size":2453,"stargazers_count":3,"open_issues_count":17,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T01:51:22.193Z","etag":null,"topics":["client-hints","react","react-hooks","user-agent"],"latest_commit_sha":null,"homepage":"https://stackblitz.com/edit/demo-react-client-hints","language":"JavaScript","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/antonybudianto.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}},"created_at":"2020-05-15T17:32:44.000Z","updated_at":"2023-09-14T03:47:21.000Z","dependencies_parsed_at":"2023-02-05T11:45:44.679Z","dependency_job_id":null,"html_url":"https://github.com/antonybudianto/react-client-hints","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Freact-client-hints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Freact-client-hints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Freact-client-hints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/antonybudianto%2Freact-client-hints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/antonybudianto","download_url":"https://codeload.github.com/antonybudianto/react-client-hints/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244806119,"owners_count":20513383,"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":["client-hints","react","react-hooks","user-agent"],"created_at":"2024-10-11T23:46:49.046Z","updated_at":"2025-03-21T13:31:51.295Z","avatar_url":"https://github.com/antonybudianto.png","language":"JavaScript","readme":"# react-client-hints\n\n[![npm version](https://badge.fury.io/js/react-client-hints.svg)](https://badge.fury.io/js/react-client-hints)\n[![Build Status](https://travis-ci.org/antonybudianto/react-client-hints.svg?branch=master)](https://travis-ci.org/antonybudianto/react-client-hints)\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://user-images.githubusercontent.com/7658554/82108716-9fad3180-975a-11ea-8ebf-957c1f0bd6fe.png\"\u003e\n\u003c/p\u003e\n\nReact Client Hints Hooks, Component, and Provider. SSR-ready and fully unit-tested.\n\n## Requirement\n\n- React 16.8.0\n\n## Features\n\n- Provide simple API for latest [Client Hints feature](https://developer.mozilla.org/en-US/docs/Glossary/Client_hints)\n- Using new React [Context API](https://reactjs.org/docs/context.html)\n- SSR-ready\n- Fully unit-tested\n\n\u003e Try it [live at StackBlitz](https://stackblitz.com/edit/demo-react-client-hints)\n\n```js\nimport React, { Component } from 'react';\nimport { render } from 'react-dom';\nimport { ClientHintsProvider, useClientHints } from 'react-client-hints';\n\nconst Hello = () =\u003e {\n  const ch = useClientHints();\n  return \u003cdiv\u003ePlatform: {ch \u0026\u0026 ch.platform}\u003c/div\u003e;\n};\n\nconst App = () =\u003e {\n  return (\n    \u003cClientHintsProvider\u003e\n      \u003cHello /\u003e\n    \u003c/ClientHintsProvider\u003e\n  );\n};\n\nrender(\u003cApp /\u003e, document.getElementById('root'));\n\n// SSR with compatible header object\nconst el = (\n  \u003cClientHintsProvider header={request.headers}\u003e\n    \u003cClientHints\u003e{ch =\u003e ch.platform}\u003c/ClientHints\u003e\n  \u003c/ClientHintsProvider\u003e\n);\n\nReactDOMServer.renderToString(el);\n```\n\n## License\n\nMIT\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonybudianto%2Freact-client-hints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fantonybudianto%2Freact-client-hints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fantonybudianto%2Freact-client-hints/lists"}