{"id":29639419,"url":"https://github.com/samdenty/ios-vibrator-pro-max","last_synced_at":"2025-07-21T20:38:03.940Z","repository":{"id":280081392,"uuid":"936938052","full_name":"samdenty/ios-vibrator-pro-max","owner":"samdenty","description":"Bringing the vibrate API for the first time to the web on iOS 18 Safari","archived":false,"fork":false,"pushed_at":"2025-04-02T21:14:03.000Z","size":75,"stargazers_count":174,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-21T01:48:10.242Z","etag":null,"topics":["ios","safari","vibration"],"latest_commit_sha":null,"homepage":"https://vibrator.dev/ios-18","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/samdenty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-22T00:52:45.000Z","updated_at":"2025-07-13T18:25:54.000Z","dependencies_parsed_at":"2025-03-26T02:24:49.149Z","dependency_job_id":"672dcb1e-80db-4b4c-bf8e-6e0f3e0136cf","html_url":"https://github.com/samdenty/ios-vibrator-pro-max","commit_stats":null,"previous_names":["samdenty/ios-vibrator-pro-max"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samdenty/ios-vibrator-pro-max","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdenty%2Fios-vibrator-pro-max","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdenty%2Fios-vibrator-pro-max/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdenty%2Fios-vibrator-pro-max/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdenty%2Fios-vibrator-pro-max/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samdenty","download_url":"https://codeload.github.com/samdenty/ios-vibrator-pro-max/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samdenty%2Fios-vibrator-pro-max/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266375788,"owners_count":23919625,"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","status":"online","status_checked_at":"2025-07-21T11:47:31.412Z","response_time":64,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["ios","safari","vibration"],"created_at":"2025-07-21T20:37:46.530Z","updated_at":"2025-07-21T20:38:03.907Z","avatar_url":"https://github.com/samdenty.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `ios-vibrator-pro-max`\n\n[![npm version](https://img.shields.io/npm/v/ios-vibrator-pro-max.svg?style=flat-square)](https://www.npmjs.com/package/ios-vibrator-pro-max)\n[![npm downloads](https://img.shields.io/npm/dm/ios-vibrator-pro-max.svg?style=flat-square)](https://www.npmjs.com/package/ios-vibrator-pro-max)\n[![Demo](https://img.shields.io/badge/Demo-blue.svg?style=flat-square)](https://ios-vibrate-api-demo.vercel.app/)\n\n\nFinally Safari added an unofficial™️ vibration API. I'm sorry to whoever who let this amazing feature/bug accidentally ship it's way into iOS 18. Tim cook please don't remove it, the web \u0026 PWAs need love too.\n\n```ts\nimport \"ios-vibrator-pro-max\";\n\nnavigator.vibrate(1000);\n```\n\n## ⚠️ Limitations\n\nThis polyfill will work without any user interaction on iOS `18` to `18.3`. In iOS `18.4` Apple [made the vibration require user interaction](https://x.com/samddenty/status/1897123571799118091). Unfortunately the way they did this, the only interaction that counts is a click (unfortunately dragging doesn't count) and the grant expires after 1s. There's no way to keep vibrating after that click grant expires, except to block the main thread - see below to enable that option\n\n\n## Durations longer than 1000ms\n\nThis will block the main thread for the duration of the vibration pattern. Only vibration patterns longer than 1s total will block. Blocking is required as it's the only way to extend the trusted event grant of the click handler (async vibrations have expiration)\n\n```ts\nimport { enableMainThreadBlocking } from \"ios-vibrator-pro-max\";\n\nenableMainThreadBlocking(true);\n\nnavigator.vibrate(2000);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamdenty%2Fios-vibrator-pro-max","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamdenty%2Fios-vibrator-pro-max","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamdenty%2Fios-vibrator-pro-max/lists"}