@skkuverse/miniapp
v0.3.0
Published
The skkuverse miniapp SDK: the web↔app bridge protocol, a typed client for it, and React bindings.
Readme
@skkuverse/miniapp
The SDK a skkuverse miniapp uses to talk to the skkuverse app. Every function is safe to call anywhere: outside the app it is a no-op or a browser fallback.
import { MiniappRoot } from '@skkuverse/miniapp/react';
createRoot(el).render(
<MiniappRoot id="mukja" dev={import.meta.env.DEV}>
<App />
</MiniappRoot>,
);import { getCapabilities, haptic, openUrl, openMapPlace } from '@skkuverse/miniapp';
haptic('light');
openUrl('https://open.spotify.com/track/…', { appUrl: 'spotify:track:…' });
if (getCapabilities().capabilities.has('map.openPlace')) openMapPlace('event:42');.page { padding-top: calc(var(--sv-inset-top) + 16px); }@skkuverse/miniappis the SDK.@skkuverse/miniapp/protocolis the contract with the app, with no DOM, React or dependencies.@skkuverse/miniapp/reactholdsMiniappRoot, which blocks plain browsers unlessbrowser="allow", and the hooks.@skkuverse/miniapp/react/uiholdsMapButton, which needs@skkuverse/ui.
Declare the shell the app draws around the page in public/skkuverse.json.
See the protocol reference.
