Skip to main content
This guide walks you through the most common integration path: provision an on-device wallet, set a PIN, and produce your first signature. It uses all three packages together, but each one is optional — skip the steps that don’t apply to your use-case.

Prerequisites

  • Flutter >=3.3.0 / Dart >=3.11
  • Android minSdk 24+ or iOS 13.0+

1

Add the packages

Add all three packages to pubspec.yaml:
Then fetch them:
2

Apply the BMONI theme

Wrap your app root with BMoniTheme.darkTheme() (or lightTheme()) so every widget in the tree picks up the correct colours and typography automatically.
3

Initialise the SDK

Call BmoniEmbeddedSdk.initialize once — before runApp is the recommended place. The defaults are pinLength: 6 and requirePin: true.
4

Provision a wallet

On first launch, call initWallet() to generate a secp256k1 keypair inside the device’s secure hardware. The returned EIP-55 address is automatically cached in flutter_secure_storage.
5

Set a PIN

The PIN gates future signing operations. It is stored only as a PBKDF2-HMAC-SHA256 digest — the raw value never touches disk.
6

Sign a message

Use signMessage for EIP-191 personal-sign flows (SIWE, login challenges):
Or signTransactionHash for a pre-computed 32-byte digest (ERC-4337 userOpHash, EIP-712, raw tx hash):
7

Handle errors

Wrap SDK calls in a try/catch and branch on BmoniSignerErrorCode:
See the full error reference for all codes.
8

Render a wallet card (optional)

If you also have bmoni_embedded_wallets_cards, wire a notifier and drop in the card widget:
See the full wallets & cards guide for the complete wiring.

Next steps

SDK configuration

Customise PIN length and the requirePin gate.

PIN management

Change, verify, and remove PINs.

Design tokens

Use BMONI colours and typography in your own widgets.

Wallet card widgets

Full API for EmbeddedWalletCard and the transactions section.