Skip to content

Configuration Parameters

Complete reference for all Ask AI Button configuration options.

Basic Configuration

javascript
window.aaib = {
  projectId: 'YOUR_PROJECT_ID'
};

All Parameters

ParameterTypeRequiredDefaultDescription
projectIdstringYes-Your unique project identifier from the dashboard
themestringNo'light'Theme mode: 'light', 'dark', or 'auto'
positionobjectNo{bottom: '20px', right: '20px'}Button position on the page
languagestringNo'en'Interface language
buttonTextstringNo'Ask AI'Text displayed on the button
placeholderstringNo'Ask a question...'Input field placeholder text
zIndexnumberNo9999Z-index for button and chat widget
hideOnMobilebooleanNofalseHide button on mobile devices
autoOpenbooleanNofalseAutomatically open chat on page load
enableHistorybooleanNotrueEnable conversation history
maxHistoryItemsnumberNo50Maximum stored conversation items
disableOnarrayNo[]Array of URL paths where button should be hidden
contextobjectNo{}Custom context providers
customStylesobjectNo{}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'
};