Configuration Parameters
Complete reference for all Ask AI Button configuration options.
Basic Configuration
javascript
window.aaib = {
projectId: 'YOUR_PROJECT_ID'
};All Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectId | string | Yes | - | Your unique project identifier from the dashboard |
theme | string | No | 'light' | Theme mode: 'light', 'dark', or 'auto' |
position | object | No | {bottom: '20px', right: '20px'} | Button position on the page |
language | string | No | 'en' | Interface language |
buttonText | string | No | 'Ask AI' | Text displayed on the button |
placeholder | string | No | 'Ask a question...' | Input field placeholder text |
zIndex | number | No | 9999 | Z-index for button and chat widget |
hideOnMobile | boolean | No | false | Hide button on mobile devices |
autoOpen | boolean | No | false | Automatically open chat on page load |
enableHistory | boolean | No | true | Enable conversation history |
maxHistoryItems | number | No | 50 | Maximum stored conversation items |
disableOn | array | No | [] | Array of URL paths where button should be hidden |
context | object | No | {} | Custom context providers |
customStyles | object | No | {} | Custom CSS styles |
Position Configuration
Control where the button appears:
javascript
// Bottom right (default)
position: {
bottom: '20px',
right: '20px'
}
// Bottom left
position: {
bottom: '20px',
left: '20px'
}
// Top right
position: {
top: '20px',
right: '20px'
}
// Centered bottom
position: {
bottom: '20px',
left: '50%',
transform: 'translateX(-50%)'
}Theme Options
javascript
// Light theme
theme: 'light'
// Dark theme
theme: 'dark'
// Auto - matches system/website theme
theme: 'auto'Language Codes
Supported languages:
'en'- English'es'- Spanish'fr'- French'de'- German'it'- Italian'pt'- Portuguese'ru'- Russian'zh'- Chinese (Simplified)'ja'- Japanese'ko'- Korean
Disable on Specific Pages
javascript
window.aaib = {
projectId: 'YOUR_PROJECT_ID',
disableOn: [
'/admin',
'/login',
'/checkout',
'/api/*' // Wildcards supported
]
};Custom Styles
Override default styles:
javascript
window.aaib = {
projectId: 'YOUR_PROJECT_ID',
customStyles: {
buttonColor: '#0066cc',
buttonHoverColor: '#0052a3',
chatBackgroundColor: '#ffffff',
chatTextColor: '#333333',
borderRadius: '8px',
fontFamily: 'Inter, sans-serif'
}
};Context Providers
Provide dynamic context about the current page:
javascript
window.aaib = {
projectId: 'YOUR_PROJECT_ID',
context: {
getCurrentPage: function() {
return document.title;
},
getPagePath: function() {
return window.location.pathname;
},
getUserId: function() {
return localStorage.getItem('userId');
},
getCustomData: function() {
return {
version: '2.0.0',
environment: 'production'
};
}
}
};Complete Example
javascript
window.aaib = {
projectId: '12345',
theme: 'auto',
language: 'en',
position: {
bottom: '24px',
right: '24px'
},
buttonText: 'Ask AI',
placeholder: 'What can I help you with?',
zIndex: 10000,
hideOnMobile: false,
autoOpen: false,
enableHistory: true,
maxHistoryItems: 100,
disableOn: ['/admin', '/login'],
customStyles: {
buttonColor: '#0066cc',
borderRadius: '12px'
},
context: {
getCurrentPage: function() {
return document.querySelector('h1')?.textContent || document.title;
}
}
};Environment-Specific Configuration
javascript
window.aaib = {
projectId: process.env.NODE_ENV === 'production'
? 'prod_12345'
: 'dev_67890',
theme: 'auto',
// Show debug info in development
debug: process.env.NODE_ENV !== 'production'
};