AI Tema
Skip to content
AI Tema
What it doesChannelsQuestions
Wiki
EN
РусскийRUEspañolESSrpskiSREnglishEN
Log in
AI Tema wiki
Before installationReady-to-use codeWhere and how to installInstallation detailsVerify installationCommon questions
AI Tema wiki/React

React · AI Tema

React chatbot: ready widget installation component

In React, connect the widget to a component lifecycle. The example creates one launcher outside the React tree, reuses the SDK and destroys its own instance when the component leaves the page.

Instructions checked: October 29, 2026

Open dashboard ↗Appearance and JavaScript API

Before installation

  1. Create a Website chat connection in AI Tema and allow your live HTTPS domain. The www and non-www addresses work together; allow other subdomains separately.
  2. Assign an incoming-message workflow to the website and activate it. Saving a draft alone does not start the bot.

Every platform uses the same lightweight AI Tema widget. It runs your workflows and does not automatically access orders, CMS data or personal data from your website.

Ready-to-use code

src/AitemaChat.jsx

The UUID from data-account in your dashboard widget snippet. This is a public connection ID, not a password or token.

Enter your ID to generate code for your website.

JSX
import { useEffect } from 'react';

const ACCOUNT_ID = 'ACCOUNT_ID';

export default function AitemaChat() {
  useEffect(() => {
    let active = true;
    let widget;
    let owned = false;

    const mount = (sdk) => {
      if (!active) return;
      const existing = sdk.get(ACCOUNT_ID);
      widget = existing || sdk.mount({ account: ACCOUNT_ID });
      owned = !existing;
    };

    if (window.Aitema?.version) {
      mount(window.Aitema);
    } else {
      window.Aitema = window.Aitema || { q: [] };
      window.Aitema.q.push(mount);
      if (!document.querySelector('script[data-aitema-sdk], script[src="https://api.aitema.cloud/api/v1/chat/widget.js"]')) {
        const script = document.createElement('script');
        script.src = 'https://api.aitema.cloud/api/v1/chat/widget.js';
        script.dataset.aitemaSdk = '';
        script.async = true;
        script.addEventListener('error', () => script.remove(), { once: true });
        document.body.append(script);
      }
    }

    return () => {
      active = false;
      if (owned) widget?.destroy();
    };
  }, []);

  return null;
}

Where and how to install

  1. Create src/AitemaChat.jsx and paste the generated component. It uses your existing React useEffect; no widget package is required.
  2. Import AitemaChat into App or a shared layout and render <AitemaChat /> once beside your router.
  3. Do not also add an automatic script with data-account to index.html. Choose component-managed installation.
  4. Run the app and check route navigation. If mounted only for one section, its widget is destroyed when leaving that section.

Installation details

  • Development StrictMode repeats setup and cleanup. The active flag prevents mounting after the component was removed.
  • The global SDK stays available for later mounts. Cleanup destroys only the instance owned by this component, leaving a pre-existing external widget intact.
Official platform documentationReact: useEffect ↗React: StrictMode ↗

Verify installation

  1. Visit the published website on the domain allowed in AI Tema. Clear the page cache if the widget has not appeared after your update.
  2. Open the chat and send a message. Complete the workflow to collect contact details; add the “Mark as lead” action to record a lead.
  3. Find the contact in “Contacts and leads” and open the conversation. Check the mobile view and navigation between pages.

Common questions

Should I turn StrictMode off?

No. The example handles repeated setup/cleanup without creating a second launcher. Keep the check enabled.

Can I use this for Next.js?

Use the separate Next.js guide with next/script. It places loading in a layout and covers application routing.

Other installation guides

functions.php

WordPress

Install AI Tema chat on WordPress with ready-to-use PHP and HTML. Includes child-theme setup, WordPress.com requirements and lead verification.

↗
HEAD

Tilda

Add AI Tema chat to Tilda through site HEAD settings or a T123 block. Includes a ready script, publishing steps and lead collection checks.

↗
layout/theme.liquid

Shopify

Connect AI Tema to a Shopify storefront with ready theme.liquid code, installation steps, domain checks and checkout limitations.

↗
Custom Code

Wix

Add AI Tema to Wix with a ready script, Body end placement, site-wide loading and published-domain checks through Custom Code.

↗
Footer code

Webflow

Connect AI Tema chat to Webflow with a ready Footer code snippet. Covers site settings, publishing and Webflow plan requirements.

↗
/local/templates/…/footer.php

1С-Битрикс

Install AI Tema on 1C-Bitrix through footer.php. Ready widget code, active-template selection and lead checks without a marketplace module.

↗
HEAD

Bitrix24 Sites

Add AI Tema to Bitrix24 Sites through custom HTML. Ready HEAD code, page-level settings and plan requirements for a published website.

↗
Custom Code → Before </body>

TapTop

Add AI Tema to TapTop with a script before body. Includes project-wide and page-level installation, publishing and custom-code requirements.

↗
Settings → General → HTML

Taplink

Connect AI Tema to Taplink through Settings → General → HTML code. Ready script, insertion scope and mobile chat verification.

↗
Códigos externos → Para la Tienda

Tiendanube

Install AI Tema in Tiendanube through Códigos externos. Ready storefront code, a Google Tag Manager alternative and checkout limitations.

↗
Сайт → Счётчики и коды → body

InSales

Add AI Tema to InSales without editing your theme. Ready HTML script, shared body insertion and conversation checks for your online store.

↗
Instant Site → Custom JavaScript code

Ecwid

Add AI Tema to Ecwid Instant Site through Custom JavaScript code. Ready script, supported plans and guidance for stores embedded in another CMS.

↗
Custom Code → Add Script

Framer

Install AI Tema in Framer through Custom Code and Add Script. Ready HTML, Once execution, page selection and navigation verification.

↗
Custom HTML → DOM Ready

Google Tag Manager

Add AI Tema with a Custom HTML tag in Google Tag Manager. Duplicate-safe script, DOM Ready trigger, Preview checks and container publishing.

↗
index.html

HTML

Add AI Tema to a plain HTML website with one script. Covers body placement, shared templates, allowed domains and installation checks.

↗
app/components/AitemaChat.jsx

Next.js

Add AI Tema to Next.js App Router with a ready next/script component, afterInteractive loading and a shared layout without duplicate downloads.

↗
AI Tema

Automated replies and lead collection for your business.

My accountTry a workflow
© 2026 AI Tema
DocumentationPrivacy PolicyTerms of Service
A gomvp.dev product ↗