first commit

This commit is contained in:
2026-07-12 15:55:18 +05:30
commit ee98026cc5
404 changed files with 44522 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# @wrnexus/mobile
SSR-safe access to Capacitor plugins from WrNexus browser code.
```bash
wrnexus mobile add @capacitor/camera
```
```ts
import { Camera } from "@capacitor/camera";
import { mobile } from "@wrnexus/mobile";
if (mobile.isNative()) {
mobile.registerPlugin("Camera", Camera);
const photo = await mobile.invoke("Camera", "getPhoto", { resultType: "uri" });
}
```
`isNative()` is false and `platform()` is `web` during SSR. `plugin()` returns
`undefined` when unavailable; `requirePlugin()` and `invoke()` throw an
actionable `MobileUnavailableError`.
Import and register Capacitor packages only from browser-owned code. Do not
import them in server routes, SSR helpers, or other Bun-only modules.