@strata-game-library/capacitor-plugin
v1.0.2
Published
Cross-platform input, device detection, and haptics for Strata 3D games
Maintainers
Readme
@strata/capacitor-plugin
Cross-platform input, device detection, and haptics for Strata 3D games. Works with Capacitor for iOS/Android native apps, Electron for desktop, and pure web.
📚 Documentation
Full documentation is available at strata.game/mobile/capacitor
🏢 Enterprise Context
Strata is the Games & Procedural division of the jbcom enterprise. This plugin is part of a coherent suite of specialized tools, sharing a unified design system and interconnected with sibling organizations like Agentic and Extended Data.
Features
- Device Detection - Platform, device type, input mode detection
- Unified Input - Touch, keyboard, and gamepad abstraction
- Haptic Feedback - Device vibration and gamepad rumble
- Screen Orientation - Lock/unlock orientation
- Safe Area Insets - Accurate safe area for notched screens
- React Hooks - Ready-to-use hooks for React/R3F integration
Installation
pnpm install @strata/capacitor-plugin
npx cap syncQuick Start
import { DeviceProvider, useDevice, useInput, useHaptics } from '@strata/capacitor-plugin/react';
function App() {
return (
<DeviceProvider>
<Game />
</DeviceProvider>
);
}
function Game() {
const device = useDevice();
const { leftStick } = useInput();
const { medium } = useHaptics();
return <GameCanvas />;
}Platform Support
| Feature | Web | iOS | Android | Electron | |---------|-----|-----|---------|----------| | Device Detection | ✅ | ✅ | ✅ | ✅ | | Touch Input | ✅ | ✅ | ✅ | ✅ | | Keyboard Input | ✅ | ⚠️ | ⚠️ | ✅ | | Gamepad Input | ✅ | ⚠️ | ⚠️ | ✅ | | Device Haptics | ⚠️ | ✅ | ✅ | ❌ | | Gamepad Haptics | ✅ | ❌ | ❌ | ✅ |
Related
- Strata Documentation - Full documentation
- Strata Core - Main library
- React Native Plugin - React Native version
License
MIT © Jon Bogaty
