capacitor-ai-chatbot

Unlock the power of smart conversations with XyberAI! Our chatbot package offers an advanced, AI-driven customer support solution designed to streamline interactions, boost engagement, and enhance user experience across web and mobile platforms. Perfect f

@xyber/capacitor-ai-chatbot

Unlock the power of smart conversations with XyberAI! Our chatbot package offers an advanced, AI-driven customer support solution designed to streamline interactions, boost engagement, and enhance user experience across web and mobile platforms. Perfect for businesses looking to modernize support and stay ahead in the digital age.

Install

npm install @xyber/capacitor-ai-chatbot
npx cap sync

API

echo(...)

echo(options: { value: string; }) => Promise<{ value: string; }>
Param Type
options { value: string; }

Returns: Promise<{ value: string; }>


initialize(...)

initialize(options: ChatbotConfig) => Promise<{ success: boolean; }>
Param Type
options ChatbotConfig

Returns: Promise<{ success: boolean; }>


showChatbot()

showChatbot() => Promise<void>

hideChatbot()

hideChatbot() => Promise<void>

sendMessage(...)

sendMessage(options: { message: string; }) => Promise<{ reply: string; }>
Param Type
options { message: string; }

Returns: Promise<{ reply: string; }>


Interfaces

ChatbotConfig

Prop Type
apiKey string
businessName string
businessLogo string
primaryColor string
secondaryColor string
position 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'
welcomeMessage string
chatbotName string
@xyberaichat/capacitor-ai-chatbot A Capacitor plugin for integrating an AI chatbot with an animated chat icon and responsive popup, supporting multiple businesses in Ionic Capacitor applications. Installation npm install @xyberaichat/capacitor-ai-chatbot npx cap sync

Usage TypeScript import { AIChatbot } from '@xyberaichat/capacitor-ai-chatbot';

async function initChatbot() { await AIChatbot.initialize({ businessId: 'business-123', apiKey: 'your-api-key', botName: 'BusinessBot', welcomeMessage: 'Welcome to our business!', }); await AIChatbot.showChatIcon();

const response = await AIChatbot.sendMessage({ message: 'Hello!' }); console.log(response.response); }

JavaScript const { AIChatbot } = window.Capacitor.Plugins;

async function initChatbot() { await AIChatbot.initialize({ businessId: 'business-123', apiKey: 'your-api-key', botName: 'BusinessBot', welcomeMessage: 'Welcome to our business!', }); await AIChatbot.showChatIcon();

const response = await AIChatbot.sendMessage({ message: 'Hello!' }); console.log(response.response); }

API

initialize(options): Initialize the chatbot with business configuration. showChatIcon(): Show the chat icon. hideChatIcon(): Hide the chat icon. sendMessage({ message }): Send a message to the chatbot and receive a response.

Notes

The chatbot UI is web-based and uses Tailwind CSS for responsiveness. Replace the mock AI response in web.ts with a real AI service (e.g., Dialogflow, OpenAI). Supports TypeScript and JavaScript for flexible integration.