{"id":23268415,"url":"https://github.com/jkulvich/devshock","last_synced_at":"2026-04-24T16:31:37.251Z","repository":{"id":111870765,"uuid":"363219982","full_name":"jkulvich/devshock","owner":"jkulvich","description":"📱🔨 The simple module to detect device shocks like side bump or knock","archived":false,"fork":false,"pushed_at":"2021-05-04T21:38:45.000Z","size":275,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T08:41:24.212Z","etag":null,"topics":["api","browser","bump","detector","device","events","hit","kick","knock","mobile","motion","motion-api","shock","ts","typescript","web"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/jkulvich.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-30T17:59:29.000Z","updated_at":"2021-05-04T21:38:48.000Z","dependencies_parsed_at":"2023-09-08T07:01:20.714Z","dependency_job_id":null,"html_url":"https://github.com/jkulvich/devshock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jkulvich/devshock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulvich%2Fdevshock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulvich%2Fdevshock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulvich%2Fdevshock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulvich%2Fdevshock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkulvich","download_url":"https://codeload.github.com/jkulvich/devshock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkulvich%2Fdevshock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32230865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"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":["api","browser","bump","detector","device","events","hit","kick","knock","mobile","motion","motion-api","shock","ts","typescript","web"],"created_at":"2024-12-19T17:18:21.821Z","updated_at":"2026-04-24T16:31:37.245Z","avatar_url":"https://github.com/jkulvich.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"![GitHub package.json version](https://img.shields.io/github/package-json/v/jkulvich/devshock?style=flat-square)\n[![CircleCI](https://img.shields.io/circleci/build/gh/jkulvich/devshock?style=flat-square)](https://github.com/jkulvich/devshock)\n[![GitHub](https://img.shields.io/github/license/jkulvich/devshock?style=flat-square)](https://github.com/jkulvich/devshock)\n[![GitHub last commit](https://img.shields.io/github/last-commit/jkulvich/devshock?style=flat-square)](https://github.com/jkulvich/devshock/commit/main)\n[![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/jkulvich/devshock?style=flat-square)](https://github.com/jkulvich/devshock)\n\n# 📱🔨 Device Shock Detector\n\nThe simple module to detect device shocks like side bump or knock. It uses\n[Motion API](https://developer.mozilla.org/en-US/docs/Web/API/DeviceMotionEvent)\nand only works in browsers.\n\nThere is many use-cases to make your site/app more interactive and featured. Several cases for example:\n\n- Knock to send feedback\n- Bump to pair\n- Knock to the back to make smth (open chat, move back and so on)\n\n[![DevShock Mobile Example](https://raw.githubusercontent.com/jkulvich/devshock/main/assets/mobile_2.jpg)](https://jkulvich.github.io/devshock)\n\n# 📦 Installation\n\n🐈 With **yarn**:\n\n```shell\nyarn add devshock\n```\n\n🛠 With **npm**:\n\n```shell\nnpm install devshock\n```\n\n# 🏗 Build \u0026 Try\n\nNavigate to [GitHub Pages hosted example](https://jkulvich.github.io/devshock).  \nIt's better to use your smartphone, so it has accelerometer.\n\nThis project written with TypeScript and it better to use it in projects\nbuilt with some assembly systems like Webpack or Gulp.\n\nAnyway, you can build it and use it as a single js file with:\n\n```shell\nyarn build\n```\n\nSo you'll get a **dist** folder with **devshock.js** which can be integrated\nin your project as raw js lib.\n\nTo test the lib use next command and follow to **https://\u003cinternal_ip\u003e:8080**\nfrom your mobile device:\n\n```shell\nyarn serve\n```\n\n# 📑 Usage\n\nTypeScript:\n```typescript\nimport DevShock, { ShockEventData } from 'devshock'\n\nconst dshock = new DevShock()\nif (dshock.available())\n    dshock.addListener('shock', (ev: ShockEventData) =\u003e {\n        console.log(ev)\n        // { timeStamp: 1620159608431, side: 'left', force: 23 }\n    })\n```\n\nJavaScript:\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/devshock/docs/devshock.js\"\u003e\u003c/script\u003e\n```\n\n```javascript\nconst dshock = new DevShock()\nif (dshock.available())\n    dshock.addListener('shock', ev =\u003e {\n        console.log(ev)\n        // { timeStamp: 1620159608431, side: 'left', force: 23 }\n    })\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkulvich%2Fdevshock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkulvich%2Fdevshock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkulvich%2Fdevshock/lists"}