Quickstart

Installation

1npm install @avalabs/avacloud-waas-react

Using the AvaCloud Organization ID

Once subscribed you will receive an orgId, which will be used to:

  1. Fetch the organization configuration from the AvaCloud API
  2. Map to the appropriate wallet service organization ID
  3. Use the mapped ID for wallet operations

Initialize and import AvaCloud WaaS into your React app

The AvaCloudWalletProvider is the entry point and should wrap your app or anywhere you plan on using the AvaCloudWallet hooks & components. It requires an AvaCloud organization ID (orgId).

1import { AvaCloudWalletProvider } from '@avalabs/avacloud-waas-react';
2
3function App() {
4 return (
5 <AvaCloudWalletProvider
6 orgId="your-avacloud-org-id" // Required AvaCloud org ID
7 chainId={43113} // Avalanche Fuji Testnet
8 >
9 <YourApp />
10 </AvaCloudWalletProvider>
11 );
12}

Properties

PropTypeDescription
orgIdstringRequired AvaCloud organization ID
authServiceUrlstring(Optional) URL of the AvaCloud authentication service. Defaults to AvaCloud’s production auth service
chainIdnumber(Optional) EVM chain ID to use (defaults to Avalanche Fuji Testnet - 43113)
darkModeboolean(Optional) Whether to use dark mode for UI components
onAuthSuccess(user: Auth0User) => void(Optional) Callback called when authentication is successful
onAuthError(error: Error) => void(Optional) Callback called when authentication fails
onWalletUpdate(wallet: WalletInfo) => voidOptional) Callback called when wallet information is updated

For any additional questions, please view our other knowledge base articles or contact a support team member via the chat button. Examples are for illustrative purposes only.

Learn More About AvaCloud | Download Case Studies | Schedule an AvaCloud Demo