@calimero-network/mero-platform
v0.1.0
Published
Framework-agnostic Calimero app-platform SDK: badge, notify, deep-link over a versioned launcher bridge. Zero React.
Downloads
193
Readme
@calimero-network/mero-platform
Framework-agnostic core of the Calimero app-platform SDK. Zero React — also consumed by the Tauri launcher shell (which implements the bridge these types define).
Deep-link
import {
DeepLinkController,
PendingIntentStore,
createLink,
getBridge,
} from "@calimero-network/mero-platform";
// One controller per app runtime — merges the initial URL, the launcher bridge
// `deep-link` event, and the PWA launchQueue into one durable intent stream.
const controller = new DeepLinkController(
new PendingIntentStore(window.localStorage),
{ location: window.location, bridge: getBridge(), launchQueue: (window as any).launchQueue },
);
controller.on((intent) => {
// fires even if the intent arrived before this handler registered, and
// replays across reload until acked
if (intent.params.invitation) joinWith(intent.params.invitation);
intent.resolve(); // ack — it won't replay
});
// generate a shareable link (always https, never calimero://)
const link = createLink("com.calimero.curb", "join", { invitation: "…" });
// → https://links.calimero.network/com.calimero.curb/join?invitation=…- Pending-intent store — captures intents to storage, dedups by content
nonce, survives reload/auth/install until
resolve(). - Bridge client —
getBridge()/hasCapability(name)over the versionedwindow.__calimero_platform__;null/falseoutside a capable launcher.
Badge and notify capabilities follow.
