DocumentationSDK Quick Start

SDK Quick Start

Integrate the AsroChat widget into any application with a single script tag. Select your framework below for a tailored integration boilerplate.

Framework Integration

Select your stack to view and download the implementation files.

⚛️

React / Next.js Integration

ReactIntegration.tsx

import { useEffect } from 'react';

export default function AsroChatWidget() {
  useEffect(() => {
    // 1. Load the script tag
    const script = document.createElement('script');
    script.src = "https://asrochat.app/sdk/chatbot-sdk.js";
    script.async = true;
    script.onload = () => {
      // 2. Initialize with your config
      window.AsroChatSDK.init({
        apiKey: 'YOUR_API_KEY',
        botId: 'YOUR_BOT_ID'
      });
    };
    document.body.appendChild(script);

    // 3. Optional: Cleanup on unmount
    return () => {
      if (window.AsroChatSDK) window.AsroChatSDK.destroy();
    };
  }, []);

  return null; // The widget is handled by the SDK
}

Next Step: Deep Configuration

Control every pixel and logic flow by fine-tuning the initialization payload.

Options Reference →