Skip to Content
🌐 Frontend SDKOverview

Frontend SDK

Embed smart wallet UI into your React application with @embarkai/ui-kit.

The @embarkai/ui-kit package provides a complete set of React components, hooks, and providers for integrating EmbarkAI smart wallets into your frontend application. It handles authentication (passkey, email, social login, external wallets), wallet management, transaction sending, and account abstraction — all with a pre-built, themeable UI.

What’s Included

  • Provider — Top-level context that configures authentication, chains, and wallet behavior.
  • ConnectWallet Button — Drop-in button that opens the login/signup flow.
  • Hooks — React hooks for session state, balances, transactions, and more.
  • Components — Pre-built UI pieces: UserOpStatus, Hash, Address, TransactionsList, KeyshareBackup.
  • Theming — Light/dark mode support with ThemeToggle and preferedColorMode config.
  • Internationalization — Multi-language support via LangToggle and custom translations.

Prerequisites

RequirementVersion
React18+
wagmi2.x
@tanstack/react-query5.x
viem2.x

Installation

npm install @embarkai/ui-kit

Peer dependencies are installed automatically. If your bundler complains, install them explicitly:

npm install wagmi viem @tanstack/react-query

Quick Start

import { Provider, ConnectWalletButton } from '@embarkai/ui-kit' function App() { return ( <Provider projectId="your-project-id"> <ConnectWalletButton /> {/* Your app content */} </Provider> ) }

The Provider sets up wagmi, session management, and the secure MPC iframe automatically. No additional configuration is required to get started — just pass your projectId from the EmbarkAI Dashboard .

Key Exports

Hooks

HookDescription
useSessionAccess session state, active chain, wallet addresses
useBalanceFetch native and token balances
useSendTransactionSend UserOperations via the smart account
useUserOpStatusTrack UserOperation lifecycle
useAddressGet the current smart account address
useActiveChainIdGet/set the active chain
useAccountSessionAccess full account session data
useLogoutProgrammatic logout
useWalletModeCheck if using linked (AA) or direct wallet mode
useNicknameResolveResolve human-readable nicknames to addresses

Components

ComponentDescription
ConnectWalletButtonFull login/signup flow in one button
UserOpStatusDisplay UserOperation status with auto-updates
HashRender a transaction/operation hash with copy and explorer link
AddressRender an address with ENS resolution and copy
TransactionsListList of recent smart account transactions
KeyshareBackupUI for backing up MPC keyshares
ThemeToggleLight/dark mode toggle
LangToggleLanguage selector

Advanced APIs

For lower-level operations, the package also exports imperative functions:

  • sendUserOperation / prepareUserOperation — Build and submit UserOperations directly.
  • signTypedData — EIP-712 typed data signing.
  • deployAccount — Deploy the smart account on-chain.
  • getAllSmartAccounts / getSmartAccountForChain — Query registered smart accounts.
  • getUserOperationReceipt / waitForUserOperationReceipt — Poll for UserOp receipts.
  • logout / jwtTokenManager / getValidTokens — Auth token management.

Next Steps

  1. Set up the Provider with your project configuration.
  2. Add the ConnectWallet button to your app.
  3. Use hooks to interact with the wallet.
Last updated on