The RP's clientId, plus an optional environment
(default 'production') and field-level overrides.
A ready-to-use UpbondClient.
init() must run on every page load to consume a redirect callback or
restore a persisted session.environment defaults to 'production', so createUpbond({ clientId })
is a complete integration. The auth leg is always the RP's own OIDC
redirect: login() sends the user to the issuer under YOUR client and the
callback leaves the id_token on your page (docs/24 D20). The default
wallet is the embedded widget on the UPBOND wallet origin (D18) — keys,
passkeys, ceremonies and recovery stay there; the RP talks EIP-1193.
connect() REQUIRES that prior login() (throws not_signed_in
otherwise) and consumes the issuer session as silent SSO — the wallet
leg never authenticates (D20 A-3). An auth-only RP needs nothing
special: it simply never calls a wallet method.wallet.mode: 'redirect') runs the MPC ceremony on the RP
page instead — the wallet's own origin and internal demos: connectWallet()
gives a view-only Layer 1 session, unlockWallet() establishes the single
per-session Layer 2 ceremony (A2), and every signature is re-gated by a
fresh biometric. The MPC stack is a lazy code-split chunk (docs/24 D5).connect() / getEthereumProvider() / openWallet(); calling the other
mode's methods throws wallet_not_configured.UpbondError config_invalid if config fails boundary
validation.
const upbond = createUpbond({
clientId: 'YOUR_CLIENT_ID',
// environment: 'staging', // omit for production
});
await upbond.init(); // consume callback / restore session
loginBtn.onclick = () => upbond.login(); // OIDC redirect under YOUR client
connectBtn.onclick = async () => { // after login: user gesture!
await upbond.connect(); // wallet-origin popup, silent SSO
const provider = await upbond.getEthereumProvider(); // EIP-1193 (ethers/viem OK)
const [address] = await provider.request({ method: 'eth_accounts' });
};
Create the browser UpbondClient — the main entry point of
@upbond/sdk. Validatesconfigonce at the boundary and wires the platform-agnostic core to the browser (sessionStorage/localStorage,windownavigation, and the lazily code-split MPC wallet core). Call it once and reuse the returned client.