{"id":39487893,"url":"https://github.com/vtex-apps/device-detector","last_synced_at":"2026-01-18T05:29:22.987Z","repository":{"id":42678202,"uuid":"196066731","full_name":"vtex-apps/device-detector","owner":"vtex-apps","description":"Consistent device detection across SSR and CSR","archived":false,"fork":false,"pushed_at":"2025-04-09T17:34:43.000Z","size":1573,"stargazers_count":1,"open_issues_count":20,"forks_count":4,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-04-09T18:43:00.270Z","etag":null,"topics":["hacktoberfest","store-framework","vtex-io"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vtex-apps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-09T19:01:58.000Z","updated_at":"2024-07-18T15:31:45.000Z","dependencies_parsed_at":"2025-04-09T18:31:40.799Z","dependency_job_id":"6fca0cb2-7a53-431a-9940-44c4b422c10b","html_url":"https://github.com/vtex-apps/device-detector","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/vtex-apps/device-detector","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex-apps%2Fdevice-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex-apps%2Fdevice-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex-apps%2Fdevice-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex-apps%2Fdevice-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vtex-apps","download_url":"https://codeload.github.com/vtex-apps/device-detector/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vtex-apps%2Fdevice-detector/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28530824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hacktoberfest","store-framework","vtex-io"],"created_at":"2026-01-18T05:29:22.349Z","updated_at":"2026-01-18T05:29:22.962Z","avatar_url":"https://github.com/vtex-apps.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Device Detector\n\nUse this app's HOC or hook to find out current device's viewport size.\n\n### Usage\n\n#### useDevice\n\nReturns an object with the format of `DeviceInfo` defined as:\n```js\ninterface DeviceInfo {\n  device: Device\n  isMobile: boolean\n}\n\nenum Device {\n  phone = 'phone',\n  tablet = 'tablet',\n  desktop = 'desktop',\n}\n```\n\n```js\nimport { useDevice } from 'vtex.device-detector'\nconst MyComponent = props =\u003e {\n  const { isMobile } = useDevice()\n  if (isMobile) { \n    // is phone or tablet!\n  }\n  return ...\n}\n```\n\nor\n\n```js\nimport { useDevice } from 'vtex.device-detector'\nconst MyComponent = props =\u003e {\n  const { device } = useDevice()\n  if (device === 'tablet') { \n    //is tablet!\n  }\n  return ...\n}\n```\n\n#### withDevice\n\nIt is a HOC, it injects two props (`isMobile` and `device`) into your component's props:\n\n```js\ntype WithDeviceProps = Props \u0026 {\n  isMobile: boolean\n  device: Device\n}\nenum Device {\n  phone = 'phone',\n  tablet = 'tablet',\n  desktop = 'desktop',\n}\n```\n\n```js\nimport { withDevice } from 'vtex.device-detector'\nconst MyComponent = props =\u003e {\n  if (props.isMobile) { \n    // is phone or tablet!\n  }\n  return ...\n}\n\nexport default withDevice(MyComponent)\n```\n\nor\n\n```js\nimport { useDevice } from 'vtex.device-detector'\nconst MyComponent = props =\u003e {\n  if (props.device === 'tablet') { \n    //is tablet!\n  }\n  return ...\n}\n\nexport default withDevice(MyComponent)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtex-apps%2Fdevice-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvtex-apps%2Fdevice-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvtex-apps%2Fdevice-detector/lists"}