Installation
Multiple ways to integrate AskIA into your project.
Prerequisites
- An AskIA account (free)
- A bot created from the dashboard
- Your bot ID
You can create a free account at the signup page
Method 1: JavaScript Widget (Recommended)
The simplest way to add AskIA to your website. The widget automatically appears at the bottom right of the page.
Installation
Simply add this line before the closing </body>
:
index.html
<script src="askia-pcg.vercel.app/api/widget/embed.js?botId=YOUR_BOT_ID"></script>
Replace YOUR_BOT_ID with your actual bot ID which you can find in the dashboard.
Method 2: Iframe
To embed the chat in a specific area of your page:
index.html
<iframe
src="askia-pcg.vercel.app/widget/preview?botId=YOUR_BOT_ID"
width="400"
height="600"
frameborder="0"
></iframe>
Method 3: React / Next.js
For React or Next.js applications, use the Script component:
pages/_app.tsx
import Script from 'next/script'
export default function MyApp({ Component, pageProps }) {
return (
<>
<Component {...pageProps} />
<Script
src="askia-pcg.vercel.app/api/widget/embed.js?botId=YOUR_BOT_ID"
strategy="lazyOnload"
/>
</>
)
}
Configuration
You can customize the widget behavior by adding parameters:
index.html
<script
src="askia-pcg.vercel.app/api/widget/embed.js?botId=YOUR_BOT_ID"
data-position="bottom-right"
data-theme="auto"
></script>
Available Parameters
data-position
- Widget position (bottom-right, bottom-left, top-right, top-left)data-theme
- Theme (light, dark, auto)
Verification
After installation, reload your page. You should see the AskIA widget appear in the corner of your page.
Congratulations! Your AI assistant is now live.