Skip to Content
⚙️ Core SDKOverview

Core SDK

Framework-agnostic SDK for authentication, transactions, and wallet management.

The @embarkai/core package is the foundation of the EmbarkAI stack. It provides low-level modules for authentication, bundler interaction, MPC key management, server-side wallets, and blockchain utilities — all without any framework dependency. Use it directly in Node.js backends, serverless functions, CLI tools, or as the engine behind @embarkai/ui-kit.

Modules

ModuleDescription
AuthJWT-based authentication, session management, and token validation
Server WalletsCreate and manage MPC wallets from your backend with ServerWalletManager
BundlerBuild, send, and track ERC-4337 UserOperations
Contract EncodingABI encoding helpers for smart contract calls
VaultKeyshare backup and restore via ShareVault (password-encrypted cloud storage)

Additional internal modules:

  • clients — Low-level API clients for TSS service, server wallet operations, and account management.
  • mpc — DKLS23 Threshold Signature Scheme primitives (DKG, signing rounds).
  • utils — Shared utilities for hex encoding, address formatting, and chain helpers.
  • config — Built-in chain configurations for all supported networks.

Installation

npm install @embarkai/core

For server-side wallet operations, you also need the TSS WASM module:

npm install dkls23-wasm

When to Use

ScenarioPackage
React frontend with UI components@embarkai/ui-kit (includes core internally)
Node.js backend, server wallets@embarkai/core
AI agent / MCP server@embarkai/mcp (includes core internally)
CLI tool or script@embarkai/core
Custom frontend (non-React)@embarkai/core

Quick Example

Server Wallet (Node.js)

import { createServerWalletManager, MemoryKeyshareStorage, } from '@embarkai/core' const manager = createServerWalletManager({ apiKey: process.env.EMBARK_API_KEY!, chainId: 994873017, // Lumia Mainnet storage: new MemoryKeyshareStorage(), // Use secure storage in production! }) // Create a wallet const wallet = await manager.createWallet('treasury_main') console.log('Smart Account:', wallet.smartAccountAddress) // Send a transaction const userOpHash = await wallet.sendUserOperation( '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', '1000000000000000000', // 1 LUMIA ) // Wait for receipt const receipt = await wallet.waitForUserOperationReceipt(userOpHash) console.log('TX Hash:', receipt.transactionHash)

Chain Configuration

import { getChainConfig, isChainSupported } from '@embarkai/core' const config = getChainConfig(994873017) // Lumia Mainnet console.log(config?.name) // 'Lumia Prism Mainnet' console.log(config?.rpcUrls[0]) // 'https://mainnet-rpc.lumia.org' console.log(config?.bundlerUrl) // 'https://api.lumiapassport.com/rundler-prism'

Architecture

@embarkai/core ├── auth/ -- JWT authentication and session tokens ├── bundler/ -- ERC-4337 UserOperation builder and sender ├── clients/ -- ServerWalletManager, ServerWalletClient ├── config/ -- Chain configs (Lumia, Sepolia, BSC, Arbitrum, Base) ├── mpc/ -- DKLS23 TSS protocol helpers ├── utils/ -- Encoding, formatting, address utilities └── vault/ -- Keyshare backup/restore with password encryption

Next Steps

  1. Set up Server Wallets for backend wallet management.
  2. Explore the Bundler for sending UserOperations.
  3. Review supported chains for network configuration.
Last updated on