@meru.app/web-bridge
v0.6.0
Published
JavaScript bridge helpers for Meru mobile PoC webviews
Maintainers
Readme
@meru.app/web-bridge
TypeScript helpers for Meru mobile PoC web apps running inside the in-app webview.
Used with the Meru Flutter app's PoC webview bridge (MeruBridgeNative channel).
Install
npm install @meru.app/web-bridgeUsage
import {
waitForSession,
requestSignAndSend,
requestAuthorization,
waitForTransactionResult,
waitForAuthorizationResult,
} from '@meru.app/web-bridge';
const session = await waitForSession();
requestSignAndSend({
envelopeXdr: unsignedXdr,
authorization: {
presentation: {
template: 'payment',
payment: {
amount: '10.00',
asset: 'USDC',
destination: 'G...',
},
},
},
});
// Minimal authorization (title + buttons only)
requestAuthorization({
authorization: {
presentation: { template: 'minimal' },
},
});
// Server-backed authorization (native fetches presentation from Meru API)
requestAuthorization({
authorization: {
source: { type: 'server', authorizationId: 'auth_abc123' },
},
envelopeXdr: unsignedXdr,
});Authorization templates
| Template | Shows |
|---|---|
| minimal | Native title + disclaimer + buttons |
| payment | Amount + destination rows |
| custom | Arbitrary fields[] rows (agents, MCP, etc.) |
Legacy summary on requestSignAndSend still maps to the payment template.
External app intents
Open Meru with only an authorization id (presentation comes from backend):
https://getmeru.com/app/authorize/{authorizationId}Protocol
Web → native: ready, signAndSendTransaction, requestAuthorization, close, track
Native → web: session, transactionSent, transactionError, transactionCancelled, authorizationGranted, authorizationDenied, authorizationError
Development
npm install
npm run buildPublish
npm login
npm publish --access public