Getting Started

Embedding scripts on your website

How to add the lead form, AI chat, and analytics scripts to any site.

Overview

inFlow gives you three embeddable scripts — each is a single <script> tag you paste into your HTML. Find your personalized snippets in Settings → Embed Scripts.

Everything loads from one entrypoint: toolkit.js. It reads data-tks-* attributes off the page and auto-mounts the matching widget. You can also drive each widget programmatically — see the per-widget pages for the mount() config and React components.

Lead Form Widget

Adds a floating button to your page. When a visitor clicks it, a multi-step consultation wizard opens. Submissions create leads in your dashboard.

  1. 1Go to Settings and copy the Lead Form Widget snippet.
  2. 2Set the data-page attribute to the path where the widget should appear (e.g. /contact). Omit it to show on every page.
  3. 3Paste the snippet into your <head> or before </body>.
  4. 4Add your domain as an Environment in Settings so the server allows requests from it.
html
<script src="https://api.inflow.build/toolkit.js" data-tks-key="pk_your_key_here" async></script>

<!-- Place where you want the form to appear -->
<div data-tks-form="FORM_ID_HERE"></div>
data-page tells the widget to only appear when window.location.pathname matches that value. Most businesses only want the form on one or two pages — showing it everywhere can feel pushy.

AI Chat Widget

Adds an AI-powered chat bubble. Visitors ask questions and the AI answers based on your business info. It can also capture leads mid-conversation.

  1. 1Copy the AI Chat Widget snippet from Settings.
  2. 2Set data-page just like the lead form widget.
  3. 3Paste it into your site's HTML.
  4. 4Make sure the domain is added as an Environment in Settings.
html
<script src="https://api.inflow.build/toolkit.js" data-tks-key="pk_your_key_here" async></script>

<!-- Place where you want the chat to appear -->
<div data-tks-chat="AGENT_ID_HERE"></div>

Analytics

Tracks page views and form interactions. No cookies, no personal data collected.

  1. 1Copy the Analytics snippet from Settings.
  2. 2Paste it into the <head> of every page you want to track.
  3. 3If you built your site with inFlow's site builder, analytics are already included — skip this step.

Environments

Your public key (pk_...) is safe in HTML because the server checks the origin of every request. If someone copies your key and uses it on a different domain, the request is rejected.

Add each domain where you embed scripts as an Environment under Settings → Environments. You can add production domains, staging URLs, and localhost for local development.

The full origin-enforcement model — environments, auto-allowed hosted domains, and the localhost dev exception — is documented in Public key authentication.