Security News
JSR Working Group Kicks Off with Ambitious Roadmap and Plans for Open Governance
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
react-user-agent-client-hints
Advanced tools
[![codecov](https://codecov.io/gh/zaknicholsdev/react-user-agent-client-hints/branch/develop/graph/badge.svg)](https://codecov.io/gh/zaknicholsdev/react-user-agent-client-hints)
React hook implementing the User-Agent Client Hints API to get information about the browser and operating system of a user.
$ npm install react-user-agent-client-hints
import { useUserAgentClientHints, Hint } from "react-user-agent-client-hints"
/*
* An array containing the hints to be returned. Declare in a useMemo or in module scope for referential stability.
*/
const hints: Hint[] = useMemo(
() => [
"architecture",
"model",
"bitness",
"platformVersion",
"fullVersionList"
],
[]
)
/*
* High entropy potentially reveals more info about the operating
* system and browser. Under the hood is async allowing time for the
* browser to request user permission, or make other checks.
*/
const highEntropyUAData = useUserAgentClientHints({ entropy: "high", hints })
/*
* Low entropy runs sync, but potentially does not reveal enough information
* able to identify a user.
*/
const lowEntropyUAData = useUserAgentClientHints({ entropy: "low" })
/*
* Can call without parameters too.
*/
const UADataNoParams = useUserAgentClientHint()
FAQs
React hook implementing the User-Agent Client Hints API to get information about the browser and operating system of a user.
We found that react-user-agent-client-hints demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
At its inaugural meeting, the JSR Working Group outlined plans for an open governance model and a roadmap to enhance JavaScript package management.
Security News
Research
An advanced npm supply chain attack is leveraging Ethereum smart contracts for decentralized, persistent malware control, evading traditional defenses.
Security News
Research
Attackers are impersonating Sindre Sorhus on npm with a fake 'chalk-node' package containing a malicious backdoor to compromise developers' projects.