@bananapus/nana-sdk-connect
v0.5.6
Published
Sign in to a Juicebox app with a passkey account from Juicebox Center or an external wallet
Downloads
1,925
Readme
@bananapus/nana-sdk-connect
Two ways into a Juicebox app: a passkey account powered by Juicebox Center, or an external wallet.
@bananapus/nana-sdk-connect/core:createConnectController(options)(headless, no React or wagmi),passkeyOption({ wallet, connected }), and for the app's/center/callbackpagedeliverCenterCallback(url, { window })thencompleteCenterCallback(wallet, url). The passkey account opens Center in a popup and the page stays; the callback page hands its URL back to the page, which finishes the exchange and runsconnected. A blocked popup falls back to a full-page redirect, where the callback page completes the exchange itself. WithpasskeyOption({ frame: true })Center opens in a frame the modal shows instead (JBConnectModalrenders it, sized by the page inside); the callback page hands its URL up to the framing page through the samedeliverCenterCallback. Center serves the sign-in framed only for apps its operator admits to frame (WALLET_FRAMEABLE_APP_ORIGINS), and the page inside offers "Open as a page" when it cannot continue there. The modal answers the frame's size reports with its own resolved theme (the--jb-connect-*custom properties and its font), so the Center page inside takes the app's colours, font and corners. The frame delegates passkey prompts and creation to Center's origin by name (it has nosrc, so the browser could not take the origin from one), so a new user can sign up inside it.@bananapus/nana-sdk-connect/wagmi:centerAccountConnector({ wallet, read }), a read-only Base connector for the passkey account.@bananapus/nana-sdk-connect/react:<JBConnectModal open controller onClose />, themed with--jb-connect-*custom properties (--jb-connect-padis the dialog's inset, which the Center frame bleeds through); the primary button names the platform prompt (Touch ID, Face ID, Windows Hello) unlesspasskeyLabeloverrides it.
The passkey account signs nothing in the app. Payments go through Center's review flow.
