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/Next.js

Next.js · AI Tema

Next.js chatbot: install with next/script

In Next.js App Router, place script loading in a shared layout. next/script loads the widget after hydration and avoids reloading it across routes in that layout. Keep your existing page structure.

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

app/components/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 Script from 'next/script';

export default function AitemaChat() {
  return (
    <Script
      id="aitema-chat"
      src="https://api.aitema.cloud/api/v1/chat/widget.js"
      data-account="ACCOUNT_ID"
      strategy="afterInteractive"
    />
  );
}

Where and how to install

  1. Create app/components/AitemaChat.jsx and paste the generated code. For src/app projects, use the equivalent path inside src.
  2. Import the component in your existing app/layout.tsx or public route-group layout.
  3. Render <AitemaChat /> once inside body after the main content. Do not replace RootLayout or remove existing metadata and providers.
  4. Run the app and visit the published domain. Check navigation between pages using that layout.

Installation details

  • afterInteractive loads the widget in the browser after hydration. beforeInteractive is unnecessary for this setup.
  • This component has no window, document or event handlers, so it does not require use client solely for installation. Chat UI still loads on first open.
Official platform documentationNext.js: loading scripts ↗Next.js: Script component ↗

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

What about Pages Router?

Render the same next/script component once in pages/_app.jsx or _app.tsx. Do not install a second script in individual pages.

Can chat appear only on public routes?

Yes. Put the component in the public route group’s shared layout instead of the application root layout.

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.

↗
src/AitemaChat.jsx

React

Install AI Tema in React with a ready useEffect component, single SDK loading and unmount cleanup. Add SPA chat without duplicate launchers.

↗
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 ↗