Avail Widgets Overview
Nexus Widget is the only element you need
All legacy standalone widgets have been deprecated and removed. Nexus Widget is the single unified component that handles swap, send (transfer), and deposit flows.
| Legacy element | Status | Nexus Widget replacement |
|---|---|---|
FastBridge |
❌ Removed | NexusWidget with config.mode = "swap" |
FastTransfer |
❌ Removed | NexusWidget with config.mode = "send" |
SwapWidget |
❌ Removed | NexusWidget with config.mode = "swap" |
Deposit |
❌ Removed | NexusWidget with config.mode = "deposit" + config.deposit |
BridgeDeposit |
❌ Removed | NexusWidget with config.mode = "deposit" + config.deposit |
UnifiedBalance |
❌ Removed | Inline balance view in Nexus Widget |
ViewHistory |
❌ Removed | Use sdk.getMyIntents() directly |
Install Nexus Widget
Default (npm — recommended):
npm install @avail-project/widgets viem wagmi @tanstack/react-queryPower users (shadcn — full source access):
npx shadcn@latest add availproject/widgets/nexusAsk the user which install method they prefer if not specified. Default to npm.
Import paths
npm:
import { NexusWidget, NexusProvider, useNexus } from "@avail-project/widgets";shadcn (local files):
import { NexusWidget } from "@/components/nexus/nexus";
import NexusProvider, { useNexus } from "@/components/nexus/NexusProvider";Integrate end-to-end in any TS/React app
1. Install project deps (npm path)
npm install @avail-project/widgets viem wagmi @tanstack/react-query2. Set up NexusProvider
npm:
"use client";
import { NexusProvider } from "@avail-project/widgets";
export function AppNexusProvider({ children }: { children: React.ReactNode }) {
return <NexusProvider config={{ network: "mainnet" }}>{children}</NexusProvider>;
}shadcn:
"use client";
import NexusProvider from "@/components/nexus/NexusProvider";
export function AppNexusProvider({ children }: { children: React.ReactNode }) {
return <NexusProvider config={{ network: "mainnet" }}>{children}</NexusProvider>;
}3. Initialize SDK on wallet connect
"use client";
import { useEffect } from "react";
import { useAccount, useConnectorClient } from "wagmi";
import type { EthereumProvider } from "@avail-project/nexus-core";
// npm path:
import { useNexus } from "@avail-project/widgets";
// shadcn path: import { useNexus } from "@/components/nexus/NexusProvider";
export function InitNexusOnConnect() {
const { status, connector } = useAccount();
const { data: walletClient } = useConnectorClient();
const { handleInit } = useNexus();
useEffect(() => {
if (status !== "connected") return;
void (async () => {
const mobileProvider = walletClient
? ({ request: (args: unknown) => walletClient.request(args as never) } as EthereumProvider)
: undefined;
const desktopProvider = await connector?.getProvider();
const provider = mobileProvider ?? (desktopProvider as EthereumProvider | undefined);
if (!provider || typeof provider.request !== "function") return;
await handleInit(provider);
})();
}, [status, connector, walletClient, handleInit]);
return null;
}4. Render Nexus Widget
npm:
import { NexusWidget } from "@avail-project/widgets";
// Swap mode (also handles bridges)
<NexusWidget config={{ mode: "swap" }} connectedAddress={address} />
// Send mode
<NexusWidget config={{ mode: "send" }} connectedAddress={address} />
// Deposit mode
<NexusWidget
config={{
mode: "deposit",
destination: {
chain: 8453,
tokens: [{ address: "0xToken...", symbol: "USDC", decimals: 6 }],
},
depositAddress: "0xContract...",
executeDeposit: (_symbol, tokenAddress, amount, _chainId, user) => ({
to: "0xContract...",
data: "0xCalldata...",
tokenApproval: { toTokenAddress: tokenAddress, amount, spender: "0xContract..." },
}),
}}
connectedAddress={address}
/>shadcn:
import { NexusWidget } from "@/components/nexus/nexus";
// Same config props, only import path changesDeposit/bridge config generation
For deposit and bridge mode, use the Avail Configurator to generate the exact depositConfig object based on your contract and token setup.
Nexus SDK agent skills
For detailed SDK integration guidance, use the Nexus SDK agent skills (.agents/skills/):
nexus-sdk-setup— SDK initialization and wallet wiringnexus-sdk-bridge-flows— bridge, bridgeAndTransfer, bridgeAndExecutenexus-sdk-swap-flows— swapWithExactIn, swapWithExactOut, swapAndExecutenexus-sdk-hooks-events— intent hooks and event streamingnexus-sdk-balances-metadata-utils— balances, supported chains/tokens, formattersnexus-sdk-integration— end-to-end integration guide
E2E readiness checklist
- Confirm wallet connects and
handleInitruns once per session. - Confirm
useNexus().nexusSDKis non-null after connect. - Confirm Nexus Widget renders and responds to mode, destination, prefill amount, and validation config.
- Confirm every flow (swap, send, deposit) can reach success.
- Confirm disconnect clears SDK state (
deinitializeNexus).
Common integration failures
- Invalid provider object:
- Ensure provider has
request().
- Ensure provider has
- Nexus Widget not rendering:
- Ensure
NexusProviderwraps your app and SDK is initialized.
- Ensure
- Empty balance/sources:
- Ensure SDK init finished and wallet is connected on a supported network.