{"id":24744644,"url":"https://github.com/qvil/use-pwa-install","last_synced_at":"2025-10-10T12:31:19.879Z","repository":{"id":38886908,"uuid":"506713414","full_name":"qvil/use-pwa-install","owner":"qvil","description":"React hook for PWA(Progressive Web App) install","archived":false,"fork":false,"pushed_at":"2022-06-28T18:10:04.000Z","size":312,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-19T13:36:53.530Z","etag":null,"topics":["hook","hooks","install","pwa","react","reactjs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/use-pwa-install","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/qvil.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":"2022-06-23T16:27:35.000Z","updated_at":"2024-09-20T13:06:59.000Z","dependencies_parsed_at":"2022-09-14T00:22:17.038Z","dependency_job_id":null,"html_url":"https://github.com/qvil/use-pwa-install","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-pwa-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-pwa-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-pwa-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-pwa-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qvil","download_url":"https://codeload.github.com/qvil/use-pwa-install/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235951171,"owners_count":19071251,"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":["hook","hooks","install","pwa","react","reactjs"],"created_at":"2025-01-28T02:19:16.496Z","updated_at":"2025-10-10T12:31:12.990Z","avatar_url":"https://github.com/qvil.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# use-pwa-install\n\n[![CI](https://github.com/qvil/use-pwa-install/actions/workflows/main.yml/badge.svg)](https://github.com/qvil/use-pwa-install/actions/workflows/main.yml)\n\nReact hook for PWA(Progressive Web App) install\n\n## Demo\n\n![Demo](example/demo.gif)\n\n## Install\n\n```\nnpm i use-pwa-install\n```\n\n## Usage\n\n```js\nimport React from 'react';\nimport usePWAInstall from 'use-pwa-install';\n\nconst App = () =\u003e {\n  const { isInstalled, install } = usePWAInstall();\n\n  return (\n    \u003cdiv\u003e\n      {isInstalled ? (\n        \u003cp\u003eApp is installed\u003c/p\u003e\n      ) : (\n        \u003cbutton onClick={install}\u003eInstall\u003c/button\u003e\n      )}\n    \u003c/div\u003e\n  );\n};\n```\n\n## Options\n\n| options     | Type     | Description                                 | Required | Default Value |\n| ----------- | -------- | ------------------------------------------- | -------- | ------------- |\n| acceptedFn  | Function | Callback function to execute when accepted  | no       | console.log() |\n| dismissedFn | Function | Callback function to execute when dismissed | no       | console.log() |\n| installedFn | Function | Callback function to execute when installed | no       | console.log() |\n\n## Return value\n\n| value       | Type     | Description          |\n| ----------- | -------- | -------------------- |\n| isInstalled | boolean  | Install state        |\n| install     | Function | App install function |\n\n## Browser compatibility\n\n- https://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent#browser_compatibility\n- https://developer.mozilla.org/en-US/docs/Web/API/Window/appinstalled_event#browser_compatibility\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqvil%2Fuse-pwa-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqvil%2Fuse-pwa-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqvil%2Fuse-pwa-install/lists"}