Detect when users shake their phone in your Capacitor app, to open feedback, undo an action or reveal a debug menu.
Capgo: push fixes to your Capacitor users in minutes, build signed iOS and Android apps without a Mac, and roll back in one click.
14-day unlimited free trial. No credit card required
🤖 Building with an AI coding agent? Install Capgo skills so Claude Code, Codex, Cursor, Copilot, or Gemini CLI know how to install and use
@capgo/capacitor-shakein your Capacitor app:npx skills add Cap-go/capgo-skills. Then ask your agent: "Add @capgo/capacitor-shake to my Capacitor app and wire it up." Agent setup guides · Hosted MCP
We build, improve and fix our plugins with heavy use of AI, so issues usually get fixed in under a day and pull requests get feedback the same day. A human still reviews, tests and merges 50+ pull requests daily.
- Most plugin issues get a fix pull request the same day, often within a couple of hours, and are usually resolved in one to two days.
- Every pull request goes through our AI review system, usually within minutes.
- Our AI pre-checks tests, code review, conventions and security, then a human reviews, tests and merges.
- A human, Martin, reviews, tests and merges 50+ pull requests every day.
- In the last 90 days, 95% of plugin issues were resolved.
Learn more about how we build with AI
- Shake event:
addListener('shake', ...)calls your code on each shake. - iOS: uses the system shake motion event.
- Android: accelerometer-based detection with a tuned threshold.
- Clean up: remove the listener when you no longer need it.
- Platforms: iOS and Android. Not available on web.
The most complete doc is available here: https://capgo.app/docs/plugins/shake/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.*.* | v8.*.* | ✅ |
| v7.*.* | v7.*.* | On demand |
| v6.*.* | v6.*.* | ❌ |
| v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-pluginsThen use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-shake` plugin in my project.
If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
npm install @capgo/capacitor-shake
npx cap syncCapacitor Shake Plugin interface for detecting shake gestures on mobile devices. This plugin allows you to listen for shake events and get plugin version information.
addListener(eventName: 'shake', listenerFunc: () => void) => Promise<PluginListenerHandle>Listen for shake event on the device.
Registers a listener that will be called whenever a shake gesture is detected. The shake detection uses the device's accelerometer to identify shake patterns.
| Param | Type | Description |
|---|---|---|
eventName |
'shake' |
The shake change event name. Must be 'shake'. |
listenerFunc |
() => void |
Callback function invoked when the phone is shaken. |
Returns: Promise<PluginListenerHandle>
Since: 1.0.0
getPluginVersion() => Promise<{ version: string; }>Get the native Capacitor plugin version.
Returns the current version of the native plugin implementation.
Returns: Promise<{ version: string; }>
Since: 1.0.0
| Prop | Type |
|---|---|
remove |
() => Promise<void> |
