@upbond/sdk - v0.0.3
    Preparing search index...

    Function createUpbond

    • Create the browser UpbondClient — the main entry point of @upbond/sdk. Validates config once at the boundary and wires the platform-agnostic core to the browser (sessionStorage/localStorage, window navigation, and the lazily code-split MPC wallet core). Call it once and reuse the returned client.

      Parameters

      • config: UpbondConfig

        The RP's clientId, plus an optional environment (default 'production') and field-level overrides.

      Returns UpbondClient

      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 default wallet is the embedded widget on the UPBOND wallet origin (D18) — keys, passkeys and ceremonies never enter the RP page; the RP talks EIP-1193. An auth-only RP needs nothing special: it simply never calls a wallet method.
      • Redirect mode (wallet.mode: 'redirect') runs the MPC ceremony on the RP page instead: 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-sdk-design.md D5).
      • The two mode's wallet methods are mutually exclusive: embedded exposes 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
      connectBtn.onclick = async () => {
      await upbond.connect(); // popup: login + wallet (user gesture!)
      const provider = await upbond.getEthereumProvider(); // EIP-1193 (ethers/viem OK)
      const [address] = await provider.request({ method: 'eth_accounts' });
      };