Installation
Install the Nexus SDK packages and dependencies in your project.
You are viewing the Nexus SDK v2 docs. For the current SDK, see the v3 docs and the v2 → v3 migration guide.
@avail-project/nexus-core and its peer dependencies into an existing project. By the end, your project will be ready for SDK initialization in the next step.
Prerequisites
- A JavaScript or TypeScript project — the SDK works with any framework or runtime (React, Node.js, vanilla JS, etc.)
- Node.js 18+ or Bun with a package manager (npm 9+, pnpm, yarn, or bun)
- An EIP-1193 compatible wallet provider to sign transactions (e.g. MetaMask via
window.ethereum, or a library like wagmi)
Wallet provider
The SDK needs an EIP-1193 provider to send transactions. In a browser you can use
window.ethereum directly. Wallet libraries like wagmi or RainbowKit are optional — they just make it easier to manage wallet connections in React apps.Step 1 — Install the core package
pnpm add @avail-project/nexus-core
What gets installed
@avail-project/nexus-core package provides:
createNexusClient— the factory function for creating a Nexus client and performing cross-chain operations- Bridge methods —
bridge(),bridgeAndTransfer(),bridgeAndExecute()for moving tokens across chains - Swap methods —
swapWithExactIn(),swapWithExactOut()for cross-chain token swaps - Balance methods —
getBalancesForBridge()andgetBalancesForSwap()for multi-chain token balances - Typed progress events — an
onEventcallback with a discriminated union (status,plan_preview,plan_confirmed,plan_progress) for tracking transaction progress - Type exports —
NexusClient,BridgeResult,EthereumProvider, and more
Step 2 — Verify the installation
import { createNexusClient } from "@avail-project/nexus-core";
const client = createNexusClient();
console.log("Nexus SDK ready");Next step
How is this guide?