{"id":13450893,"url":"https://github.com/BRA1L0R/use-videocard","last_synced_at":"2025-03-23T16:32:37.211Z","repository":{"id":40763239,"uuid":"275444832","full_name":"BRA1L0R/use-videocard","owner":"BRA1L0R","description":"React hook to fetch the graphics card information of the client using canvas","archived":true,"fork":false,"pushed_at":"2022-06-24T10:27:28.000Z","size":1347,"stargazers_count":10,"open_issues_count":10,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-25T22:02:24.510Z","etag":null,"topics":["javascript","library","react","reacthooks","reactjs","typescript"],"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/BRA1L0R.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-27T20:03:24.000Z","updated_at":"2023-01-27T23:10:59.000Z","dependencies_parsed_at":"2022-07-29T12:48:54.855Z","dependency_job_id":null,"html_url":"https://github.com/BRA1L0R/use-videocard","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/BRA1L0R%2Fuse-videocard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BRA1L0R%2Fuse-videocard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BRA1L0R%2Fuse-videocard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BRA1L0R%2Fuse-videocard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BRA1L0R","download_url":"https://codeload.github.com/BRA1L0R/use-videocard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221856520,"owners_count":16892456,"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":["javascript","library","react","reacthooks","reactjs","typescript"],"created_at":"2024-07-31T07:00:39.920Z","updated_at":"2024-10-28T16:32:08.835Z","avatar_url":"https://github.com/BRA1L0R.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":[],"readme":"![](assets/logo.svg)\n\n# `use-videocard`\n![https://www.npmjs.com/package/use-videocard](https://img.shields.io/npm/v/use-videocard?style=for-the-badge)\n![](https://img.shields.io/github/languages/code-size/BRA1L0R/use-videocard?style=for-the-badge)\n![https://github.com/BRA1L0R/use-videocard/blob/master/LICENSE.md](https://img.shields.io/github/license/BRA1L0R/use-videocard?style=for-the-badge)\n![https://www.npmjs.com/package/use-videocard](https://img.shields.io/npm/dy/use-videocard?style=for-the-badge)\n\n## Installation\nThis package can be found in the NPM registry, install it using this command:\n#### With _npm_:\n```\nnpm install use-videocard\n```\n\n#### With _yarn_:\n```\nyarn add use-videocard\n```\n\n## Example\n[![Edit sweet-night-sgsyw](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/sweet-night-sgsyw?fontsize=14\u0026hidenavigation=1\u0026theme=dark)\n```tsx\nimport React from 'react'\nimport useVideoCard from 'use-videocard'\n\nfunction App() {\n  const graphics = useVideoCard()\n\n  return (\n    \u003cdiv className=\"App\"\u003e\n      \u003cp\u003eVendor: { graphics?.unmasked.vendor }\u003c/p\u003e\n      \u003cp\u003eGPU: { graphics?.unmasked.renderer }\u003c/p\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n## API\n### `useVideoCard (gl?: WebGLRenderingContext): GraphicsInformation`\n- `gl`: The WebGLRenderingContext which we want to extract the information from. _NOTE: this field is *OPTIONAL*, the hook creates a canvas without appending it to the dom, but if you really want to specify the `WebGLRenderingContext` then set this field_\n\n### `GraphicsInformation`\n```ts\ninterface GraphicsInformation {\n    renderer: string,\n    vendor: string,\n    unmasked: {\n        vendor: string,\n        renderer: string\n    }\n}\n```\n\n- renderer: The masked renderer ID\n- vendor: The masked vendor ID\n- unmasked:\n  - vendor: The unmasked vendor name. _es: `NVIDIA Corporation`_\n  - renderer: The unmasked renderer name (the graphics card model and the pci version). _es: `Geforce GTX 1070/PCIe/SSE2`_\n\n## Contributors\n\u003ca href=\"https://github.com/BRA1L0R\"\u003e\u003cimg style=\"height:auto;\" alt=\"\" src=\"https://avatars2.githubusercontent.com/u/17928339?s=460\u0026u=f7f92a4673f1286094c282b3ee7b46076527ac72\u0026v=4\" width=\"80\" height=\"80\"\u003e\u003ca/\u003e\n\u003ca href=\"https://github.com/talentlessguy\"\u003e\u003cimg style=\"height:auto;\" alt=\"\" src=\"https://avatars3.githubusercontent.com/u/35937217?s=460\u0026amp;u=d8f2691645359f6499cd3ded31b22c202e08d00e\u0026amp;v=4\" width=\"80\" height=\"80\"\u003e\u003ca/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBRA1L0R%2Fuse-videocard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FBRA1L0R%2Fuse-videocard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FBRA1L0R%2Fuse-videocard/lists"}