{"id":24744649,"url":"https://github.com/qvil/use-before-install-prompt","last_synced_at":"2026-04-11T06:33:31.752Z","repository":{"id":37949110,"uuid":"506340169","full_name":"qvil/use-before-install-prompt","owner":"qvil","description":"React hook for beforeinstallprompt event","archived":false,"fork":false,"pushed_at":"2022-06-25T02:16:59.000Z","size":129,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T02:19:10.955Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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-22T17:16:29.000Z","updated_at":"2022-06-23T05:51:16.000Z","dependencies_parsed_at":"2022-09-02T18:52:27.417Z","dependency_job_id":null,"html_url":"https://github.com/qvil/use-before-install-prompt","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-before-install-prompt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-before-install-prompt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-before-install-prompt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvil%2Fuse-before-install-prompt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qvil","download_url":"https://codeload.github.com/qvil/use-before-install-prompt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245028482,"owners_count":20549526,"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":[],"created_at":"2025-01-28T02:19:16.869Z","updated_at":"2025-12-30T23:42:39.403Z","avatar_url":"https://github.com/qvil.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# This project has been deprecated. Move to [use-pwa-install](https://www.npmjs.com/package/use-pwa-install)\n\n# use-before-install-prompt\n\nReact hook for beforeinstallprompt event\n\n## Install\n\n```\nnpm i use-before-install-prompt\n```\n\n## Usage\n\n\u003c!-- [Demo]() --\u003e\n\n```js\nimport React from 'react';\nimport useBeforeInstallPrompt from 'use-before-install-prompt';\n\nconst App = () =\u003e {\n  const { isInstalled, addToHomeScreen } = useBeforeInstallPrompt();\n\n  return (\n    \u003c\u003e\n      {!isInstalled \u0026\u0026 (\n        \u003cbutton onClick={addToHomeScreen}\u003eAdd to home screen\u003c/button\u003e\n      )}\n    \u003c/\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| addToHomeScreen | Function | Add to home screen function |\n\n## Browser compatibility\n\nhttps://developer.mozilla.org/en-US/docs/Web/API/BeforeInstallPromptEvent#browser_compatibility\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqvil%2Fuse-before-install-prompt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqvil%2Fuse-before-install-prompt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqvil%2Fuse-before-install-prompt/lists"}