JSPM

@strata-game-library/capacitor-plugin

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q22562F
  • License MIT

Cross-platform input, device detection, and haptics for Strata 3D games

Package Exports

  • @strata-game-library/capacitor-plugin
  • @strata-game-library/capacitor-plugin/react

Readme

@strata/capacitor-plugin

npm version License: MIT

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 sync

Quick 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

License

MIT © Jon Bogaty