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
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.
npm install @xyber/capacitor-ai-chatbot
npx cap sync
echo(options: { value: string; }) => Promise<{ value: string; }>
Param | Type |
---|---|
options |
{ value: string; } |
Returns: Promise<{ value: string; }>
initialize(options: ChatbotConfig) => Promise<{ success: boolean; }>
Param | Type |
---|---|
options |
ChatbotConfig |
Returns: Promise<{ success: boolean; }>
showChatbot() => Promise<void>
hideChatbot() => Promise<void>
sendMessage(options: { message: string; }) => Promise<{ reply: string; }>
Param | Type |
---|---|
options |
{ message: string; } |
Returns: Promise<{ reply: string; }>
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 |
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.