Platform Installation Guides4 min readUpdated November 2026

React Component & Hook Installation Guide

Implement Rajlav AI in React single-page applications with clean TypeScript component wrappers and route persistence.

React Component Wrapper#

Use this clean React wrapper component inside your root App component:

React Wrapper Component
import { useEffect } from 'react';

export function SmartConnectWidget({ businessId }: { businessId: string }) {
  useEffect(() => {
    const script = document.createElement('script');
    script.src = 'https://ai.rajlav.co.in/widget/smart-connect.js';
    script.setAttribute('data-business-id', businessId);
    script.setAttribute('data-position', 'bottom-right');
    script.async = true;
    document.body.appendChild(script);

    return () => {
      document.body.removeChild(script);
    };
  }, [businessId]);

  return null;
}

Was this article helpful?

Your feedback helps our team improve technical documentation.

Related Guides & Tutorials