Documentation Index Fetch the complete documentation index at: https://mintlify.com/availproject/nexus-sdk/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The NexusSDK class is the main entry point for all Avail Nexus SDK operations. It provides methods for:
Cross-chain token bridging
Token swapping (exact-in and exact-out)
Smart contract execution with automatic bridging
Balance management across chains
Intent tracking and management
Constructor
import { NexusSDK } from '@avail-project/nexus-core' ;
const sdk = new NexusSDK ( config ? );
Configuration options for the SDK network
'mainnet' | 'testnet' | NetworkConfig
default: "mainnet"
Network environment to use
Chain ID for SIWE (Sign-In with Ethereum) signing
Analytics configuration options Enable or disable analytics tracking
Custom PostHog API key (uses Avail’s instance by default)
Application metadata for analytics Privacy configuration Anonymize wallet addresses by hashing
Exclude transaction amounts from analytics
Properties
utils
Utility functions for formatting, validation, and chain information. See Utilities for details.
analytics
sdk . analytics : AnalyticsManager
Analytics manager for tracking events and operations. See the Analytics guide for usage.
hasEvmProvider
sdk . hasEvmProvider : boolean
Indicates whether an EVM provider has been successfully set.
Examples
Basic Initialization
import { NexusSDK } from '@avail-project/nexus-core' ;
const sdk = new NexusSDK ({ network: 'mainnet' });
await sdk . initialize ( window . ethereum );
With Debug Logging
const sdk = new NexusSDK ({
network: 'mainnet' ,
debug: true ,
});
With Custom Analytics
const sdk = new NexusSDK ({
network: 'mainnet' ,
analytics: {
enabled: true ,
posthogApiKey: 'your-posthog-key' ,
posthogApiHost: 'https://your-posthog-instance.com' ,
appMetadata: {
appName: 'My DApp' ,
appVersion: '1.0.0' ,
},
privacy: {
anonymizeWallets: true ,
anonymizeAmounts: true ,
},
},
});
Testnet Configuration
const sdk = new NexusSDK ({ network: 'testnet' });
await sdk . initialize ( provider );
// Now all operations use testnet chains
const balances = await sdk . getBalancesForBridge ();
API Reference
For detailed method documentation, see:
Initialization Initialize and manage SDK lifecycle
Quick Start Get started with the SDK