⚠️
Important! We’ve moved to V3! This documentation is for V2 only and will be updated in May.
Developer Hub
🔮 For applications
SDK
Setup

Setup

To enable full functionality of AzuroSDK hooks, you need to configure the SDK's main provider component.

AzuroSDKProvider

Wrap your application with AzuroSDKProvider to initialize the SDK context. This is the only setup step required to start using the SDK's hooks.

import { AzuroSDKProvider } from '@azuro-org/sdk'
import { WagmiProvider, createConfig } from 'wagmi'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { polygonAmoy } from 'viem/chains'
 
const wagmiConfig = createConfig(config)
const queryClient = new QueryClient()
 
function Providers(props: { children: React.ReactNode }) {
  const { children } = props
 
  return (
    <QueryClientProvider client={queryClient}>
      <WagmiProvider config={wagmiConfig}>
        <AzuroSDKProvider initialChainId={polygonAmoy.id}>
          {children}
        </AzuroSDKProvider>
      </WagmiProvider>
    </QueryClientProvider>
  )
}

You can now start using AzuroSDK hooks anywhere inside your app tree.

For advanced configuration, see the AzuroSDKProvider documentation.

⚠️
AzuroSDKProvider must be used inside a valid WagmiProvider context.