{"id":48433826,"url":"https://github.com/sumitsahoo/web-haptic-engine","last_synced_at":"2026-04-06T12:01:20.244Z","repository":{"id":349489101,"uuid":"1202530496","full_name":"sumitsahoo/web-haptic-engine","owner":"sumitsahoo","description":"Cross-platform (iOS, Android and Web) haptic feedback engine for the web","archived":false,"fork":false,"pushed_at":"2026-04-06T07:28:10.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T08:42:29.938Z","etag":null,"topics":["android","haptic-feedback","haptic-interface","ios","react","typescript"],"latest_commit_sha":null,"homepage":"https://sumitsahoo.github.io/web-haptic-engine/","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/sumitsahoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"ko_fi":"sumitsahoo21"}},"created_at":"2026-04-06T05:48:31.000Z","updated_at":"2026-04-06T07:27:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sumitsahoo/web-haptic-engine","commit_stats":null,"previous_names":["sumitsahoo/web-haptic-engine"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sumitsahoo/web-haptic-engine","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumitsahoo%2Fweb-haptic-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumitsahoo%2Fweb-haptic-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumitsahoo%2Fweb-haptic-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumitsahoo%2Fweb-haptic-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sumitsahoo","download_url":"https://codeload.github.com/sumitsahoo/web-haptic-engine/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sumitsahoo%2Fweb-haptic-engine/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31471466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T08:36:52.050Z","status":"ssl_error","status_checked_at":"2026-04-06T08:36:51.267Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["android","haptic-feedback","haptic-interface","ios","react","typescript"],"created_at":"2026-04-06T12:01:19.358Z","updated_at":"2026-04-06T12:01:20.237Z","avatar_url":"https://github.com/sumitsahoo.png","language":"TypeScript","funding_links":["https://ko-fi.com/sumitsahoo21"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  \u003ch1\u003e📳 Web Haptic Engine\u003c/h1\u003e\n\n  \u003cp\u003eA cross-platform haptic feedback engine for the web.\u003cbr\u003e\n  Supports Android vibration, iOS Taptic feedback, audio impulse synthesis, drag haptics, and 23 built-in presets.\u003c/p\u003e\n\n  \u003cp\u003e\n    \u003ca href=\"https://www.npmjs.com/package/web-haptic-engine\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/web-haptic-engine\" alt=\"npm version\" /\u003e\u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-yellow.svg\" alt=\"MIT License\" /\u003e\u003c/a\u003e\n    \u003cimg src=\"https://img.shields.io/badge/platform-web-blue\" alt=\"Platform\" /\u003e\n    \u003cimg src=\"https://img.shields.io/badge/typescript-strict-blue\" alt=\"TypeScript\" /\u003e\n    \u003ca href=\"https://sumitsahoo.github.io/web-haptic-engine/docs/\"\u003e\u003cimg src=\"https://img.shields.io/badge/docs-VitePress-646cff\" alt=\"Documentation\" /\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\n\u003c/div\u003e\n\n---\n\n## ✨ Features\n\n| Category                   | Details                                                                                                 |\n| -------------------------- | ------------------------------------------------------------------------------------------------------- |\n| 📱 **Android Vibration**   | Full `navigator.vibrate()` pattern support with intensity-scaled durations                              |\n| 🍎 **iOS Taptic**          | Exploits the `\u003cinput type=\"checkbox\" switch\u003e` toggle to trigger native Taptic Engine feedback           |\n| 🔊 **Audio Impulse Layer** | 8 synthesized AudioBuffer impulses (`tick`, `tap`, `thud`, `click`, `snap`, `buzz`, `confirm`, `harsh`) |\n| 👆 **Drag Haptics**        | Touchmove-driven haptic feedback with distance threshold — works reliably on iOS                        |\n| 🎛️ **23 Presets**          | Ready-to-use patterns: `success`, `warning`, `error`, `heartbeat`, `spring`, `buzz`, and more           |\n| 🔗 **Sequences**           | Chain presets with delays, repeats, and custom gaps                                                     |\n| 〰️ **Easing Functions**    | `linear`, `easeIn`, `easeOut`, `easeInOut`, `bounce`, `spring`                                          |\n| 📦 **Zero Dependencies**   | No external runtime dependencies — pure TypeScript                                                      |\n\n---\n\n## 📚 Documentation\n\nFull documentation with framework integration guides is available at **[sumitsahoo.github.io/web-haptic-engine/docs](https://sumitsahoo.github.io/web-haptic-engine/docs/)**.\n\n- [Getting Started](https://sumitsahoo.github.io/web-haptic-engine/docs/guide/getting-started)\n- [React Guide](https://sumitsahoo.github.io/web-haptic-engine/docs/frameworks/react)\n- [Next.js Guide](https://sumitsahoo.github.io/web-haptic-engine/docs/frameworks/nextjs)\n- [Vue Guide](https://sumitsahoo.github.io/web-haptic-engine/docs/frameworks/vue)\n- [API Reference](https://sumitsahoo.github.io/web-haptic-engine/docs/api/)\n- [Presets](https://sumitsahoo.github.io/web-haptic-engine/docs/guide/presets)\n\n---\n\n## 📥 Installation\n\n```bash\nnpm install web-haptic-engine\n```\n\n```bash\npnpm add web-haptic-engine\n```\n\n```bash\nyarn add web-haptic-engine\n```\n\n---\n\n## 🚀 Quick Start\n\n```ts\nimport { haptic } from \"web-haptic-engine\";\n\nawait haptic(\"success\");\nawait haptic(\"heavy\", { intensity: 0.8 });\n```\n\nSee the [full documentation](https://sumitsahoo.github.io/web-haptic-engine/docs/guide/getting-started) for engine setup, drag haptics, sequences, custom presets, and framework-specific guides.\n\n---\n\n## 🧑‍💻 Development\n\n```bash\n# Install dependencies\nvp install\n\n# Build the library\nvp pack\n\n# Run tests\nvp test\n\n# Watch mode (rebuild on changes)\nvp pack --watch\n\n# Start docs dev server\nvp run docs:dev\n\n# Build docs for production\nvp run docs:build\n```\n\n---\n\n## 🎮 Demo\n\nTry the live demo at **[sumitsahoo.github.io/web-haptic-engine](https://sumitsahoo.github.io/web-haptic-engine/)**.\n\nAn interactive demo is also included in the `demo/` directory. It showcases all 23 presets, drag haptics, impulse buffers, sequences, and real-time controls for intensity and audio gain.\n\n```bash\n# Install dependencies (if not already done)\nvp install\n\n# Start the demo dev server\nvp run demo\n```\n\nThis launches a Vite dev server. Open the URL shown in the terminal (typically `http://localhost:5173`) in your browser. For the full haptic experience, open it on a mobile device — Android for vibration, iOS Safari for Taptic feedback. On desktop, audio impulses still play as a fallback.\n\n---\n\n## 📁 Project Structure\n\n```\nweb-haptic-engine/\n├── src/\n│   ├── core/               # Types, constants, easings \u0026 presets\n│   ├── audio/              # Web Audio impulse synthesis \u0026 playback\n│   ├── platform/           # Platform detection \u0026 adapters (Android, iOS)\n│   ├── interactions/       # User interaction patterns (drag haptics)\n│   ├── haptic-engine.ts    # Main HapticEngine class \u0026 convenience helpers\n│   └── index.ts            # Public API exports\n├── docs/                   # VitePress documentation site\n│   ├── .vitepress/         # VitePress config \u0026 theme\n│   ├── guide/              # Getting started, presets, platform support\n│   ├── frameworks/         # React, Next.js, Vue integration guides\n│   └── api/                # API reference (HapticEngine, DragHaptics, Types)\n├── demo/\n│   ├── index.html          # Demo page\n│   ├── main.ts             # Demo app (imports from library)\n│   └── vite.config.ts      # Vite config for demo dev server\n├── tests/\n│   └── index.test.ts       # Unit tests\n├── tsdown.config.ts        # Library build config\n├── vite.config.ts          # Vite+ unified config\n├── tsconfig.json           # TypeScript config\n└── package.json\n```\n\n---\n\n## 💡 Acknowledgements\n\nThis project was initially inspired by [web-haptics](https://github.com/lochie/web-haptics) by [@lochie](https://github.com/lochie).\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) guide for details.\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT License** — feel free to use it for both personal and commercial purposes. See the [LICENSE](LICENSE) file for details.\n\n---\n\n\u003cp align=\"center\"\u003e\n  Built with ❤️ by \u003ca href=\"https://github.com/sumitsahoo\"\u003eSumit Sahoo\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumitsahoo%2Fweb-haptic-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsumitsahoo%2Fweb-haptic-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsumitsahoo%2Fweb-haptic-engine/lists"}