AvaCloud
UsageAdvanced Usage

Advanced Usage

Theme Customization

Use the ThemeProvider to customize the appearance of UI components:

import { ThemeProvider } from '@avalabs/avacloud-waas-react';
 
function App() {
  return (
    <ThemeProvider darkMode={true}>
      <YourApp />
    </ThemeProvider>
  );
}

Custom Authentication Flow

You can implement a custom authentication flow using the lower-level hooks:

import { usePostMessage } from '@avalabs/avacloud-waas-react';
 
function CustomAuth() {
  const { sendMessage, lastMessage } = usePostMessage();
 
  const handleCustomLogin = () => {
    sendMessage({
      type: 'login',
      payload: {
        // Custom payload
      }
    });
  };
 
  // Handle response in useEffect
  useEffect(() => {
    if (lastMessage?.type === 'login_success') {
      // Handle successful login
    }
  }, [lastMessage]);
 
  return (
    <button onClick={handleCustomLogin}>
      Custom Login
    </button>
  );
}

If you need more help, explore our other articles or reach out to our support team via chat or email support@avacloud.io. All examples provided are for demonstration purposes only.

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

On this page