zzzRespant
← All integration guidesIntegration guide

Add Respant to your React site

A React app's actual page shell lives in one plain HTML file that your build tool injects the compiled app into, not inside any .jsx or .tsx component. Find that one file and you're done, it never needs touching again.

Step by step

1

Vite projects: open index.html at your project root

If you scaffolded with Vite (npm create vite@latest), the HTML shell is index.html sitting directly in your project's root folder, not inside src/.

2

Create React App projects: open public/index.html

If you scaffolded with Create React App (npx create-react-app), the HTML shell is at public/index.html instead, inside the public folder specifically.

3

Paste the snippet before </body>

In whichever file applies to your setup, find the closing </body> tag and paste your Respant embed snippet on its own line directly above it.

4

Rebuild and deploy

This file is part of your source code, not a build artifact, so a normal build and deploy (npm run build, then your usual deploy step) carries the change through automatically. Confirm on your live URL, not just localhost.

Building with Next.js instead of plain React? Use the dedicated Next.js guide, it has its own recommended pattern using the next/script component instead of a raw HTML file.

Your embed snippet

This is the exact line you paste. Your real snippet has your own chatbot's widget key filled in automatically, find it on your live preview screen right after you build your chatbot, or anytime from your dashboard under Website integration.

<script src="https://app.flenrok.com/flenrok-loader.js" data-respant-key="YOUR_WIDGET_KEY" async></script>

Don't type this by hand, copy it directly from your dashboard so the widget key matches your actual chatbot.

Test your widget

Open your live site in a normal browser tab, not a preview or editor view, and give the page a few seconds to fully load. Your chatbot's launcher should appear in the corner of the screen. Click it, type a real question a customer might ask, and check that the answer sounds right. If nothing shows up, clear your browser cache and reload, or double-check the snippet was saved in the right place and that you're looking at the published version of your site, not a draft.

Still stuck? Email us with your site URL and we'll take a look, or open the chatbot on the Respant site itself and ask it, it's trained to walk you through this exact step.

Haven't built your chatbot yet?

Build a working demo in minutes, free, no credit card. You'll get this exact snippet the moment it's ready.

Build My Demo Bot, Free