Documentation

Documentation

How to integrate Flash AI with your website

Quick Start

Adding Flash AI to your website takes just 3 steps.

1

Order your bot

Go to flashai.pl, click "Order" and configure your AI assistant — name, personality, knowledge base.

2

Paste the code

Add one line to your website, just before the closing </body> tag:

HTML
<script src="https://flashai.pl/widget.js" data-ai="TWOJE_BOT_ID"></script>

Done!

The chat widget will appear in the bottom-right corner of your website. Your AI assistant is ready to talk to visitors.

Widget Configuration

Customize widget behavior using HTML attributes on the script tag.

Attribute Description
data-ai (required) Your bot ID
data-name Display name in chat header
data-color Accent color (hex)
data-auto-open Auto-open chat on page load
data-fullscreen Fullscreen mode
data-lang Force interface language

Full example

HTML
<script src="https://flashai.pl/widget.js"
  data-ai="twoje_bot_id"
  data-name="Asystent Sklepu"
  data-color="#ff6b00"
  data-auto-open="true"></script>

JavaScript API

Control the widget programmatically from your website code.

Method Description
FlashAI.open() Opens chat window
FlashAI.close() Closes chat window
FlashAI.toggle() Toggles chat open/closed
FlashAI.send("text") Sends a message immediately
FlashAI.setInput("text") Sets input text without sending
FlashAI.isOpen Checks if chat is open

Usage examples

HTML
<!-- Button that opens the chat -->
<button onclick="FlashAI.open()">Chat with us</button>

<!-- Button that sends a specific question -->
<button onclick="FlashAI.send('I want to book an appointment')">Book now</button>

<!-- Link that pre-fills the input -->
<a href="#" onclick="FlashAI.open().setInput('Pricing')">Ask about pricing</a>

Opening chat via link

Add #flashai-open to any URL and the chat will open automatically. Perfect for QR codes, email links, or buttons.

URL
https://your-website.com/#flashai-open

Advanced Configuration

For full control, use the JavaScript configuration object before loading the widget script.

HTML + JavaScript
<script>
window.FlashAI = {
  botId: "twoje_bot_id",
  config: {
    agentName: "Asystent",
    primaryColor: "#00f5ff",
    position: "bottom-right",
    languages: ["pl", "en"],
    trigger: {
      type: "delay",
      delay: 5
    },
    teaser: {
      enabled: true,
      delay: 3,
      message: "Hi! Need help?"
    }
  }
};
</script>
<script src="https://flashai.pl/widget.js"></script>

Trigger types

"immediate" Widget appears immediately
"delay" Appears after specified seconds
"scroll" Appears after scrolling specified %
"engagement" Appears after user engagement
"exit" Appears on exit intent
"manual" Only via API call

Need help?

Check our API Reference or join the Community.

Hi! 👋 I'm FlashAI. How can I help you boost your sales today?

FlashAI Assistant

Online

Powered by SymfoniX