Chatbot Integration

Embed the Jamii AI Chatbot on any website in minutes. Available on Pro and Enterprise plans.

Quick Start

Add two snippets before your closing </body> tag β€” that's all you need:

HTML
<script>
  window.JamiiAIWidget = {
    apiUrl: "https://api.jamiiai.com"
  };
</script>
<script src="https://cdn.jamiiai.com/widget/jamiiai-widget.js"></script>

A floating chat button appears in the bottom-right corner of your page. The widget auto-injects its own CSS β€” no extra stylesheet needed.

How It Works

The chatbot widget follows a simple flow:

  1. Click the floating chat button to open the panel
  2. Sign in with your email (username) and secret answer
  3. Chat with the AI assistant in real time
  4. Reset the conversation at any time with the ↻ button
  5. Logout to clear the session (token stored in sessionStorage)

The widget is fully self-contained β€” a single JavaScript file with built-in styles, i18n, authentication, and chat functionality. On the Pro plan it provides a simple chat interface using three core endpoints. On the Enterprise plan it unlocks a full multi-modality experience with 82 endpoints across 15 modalities β€” including code generation, image & video analysis, voice, document generation, knowledge base, and more.

Configuration Options

All options are set on window.JamiiAIWidget before loading the script:

OptionTypeDefaultDescription
apiUrlstring""Required. Your Jamii AI API base URL
langstring"en""en" or "fr"
positionstring"bottom-right""bottom-right" or "bottom-left"
planstring"pro""pro" or "enterprise"
themeobject{}Custom colours (Enterprise only)
brandingobject{}Custom branding (Enterprise only)

Theme Options Enterprise

Enterprise customers can fully customise the widget's visual appearance:

PropertyTypeDefaultDescription
primaryColorstring"#7c3aed"Buttons, user bubbles, accents
accentColorstring"#22d3ee"Header gradient secondary colour
fontFamilystring"'Inter', system-ui, sans-serif"Widget font stack
JavaScript
window.JamiiAIWidget = {
  apiUrl: "https://api.jamiiai.com",
  plan: "enterprise",
  theme: {
    primaryColor: "#0066ff",
    accentColor: "#00ccaa",
    fontFamily: "'Poppins', sans-serif"
  }
};

Branding Options Enterprise

Enterprise users can white-label the widget with their own branding:

PropertyTypeDefaultDescription
titlestringnullHeader title text
subtitlestringnullHeader subtitle text
logostringnullCustom SVG logo markup
showPoweredBybooleanfalseShow/hide "Powered by Jamii AI"
JavaScript
branding: {
  title: "Acme Support",
  subtitle: "We're here to help",
  logo: '<svg viewBox="0 0 32 32">...</svg>',
  showPoweredBy: false
}

Plan Comparison

FeatureProEnterprise
Embeddable chatbot widgetβœ…βœ…
Bilingual support (EN / FR)βœ…βœ…
Login / Chat / Reset flowβœ…βœ…
Mobile responsiveβœ…βœ…
Position customisationβœ…βœ…
"Powered by Jamii AI" badgeRequiredOptional
Custom branding (title, logo)β€”βœ…
Custom theme coloursβ€”βœ…
White-label modeβ€”βœ…
Multi-Modality (Enterprise Only)
Code generation, review & refactorβ€”βœ…
Text AI (translate, summarize, sentiment, extract)β€”βœ…
Image generation & descriptionβ€”βœ…
Voice (speech-to-text, text-to-speech, audio chat)β€”βœ…
Video transcription & descriptionβ€”βœ…
Document generation (Word, PowerPoint, PDF)β€”βœ…
Database natural-language queriesβ€”βœ…
Web page summarisationβ€”βœ…
African-language AI (chat, translate, detect)β€”βœ…
Africa Life (agriculture, education, legal)β€”βœ…
Africa Culture (proverbs, storytelling)β€”βœ…
AI Agent (autonomous task execution)β€”βœ…
Embeddings & memory (store / recall / clear)β€”βœ…
Knowledge Base (ingest, query, manage)β€”βœ…
File upload & downloadβ€”βœ…
Server-Sent Events (SSE) streamingβ€”βœ…

Example β€” Pro Plan (Minimal)

HTML
<script>
  window.JamiiAIWidget = {
    apiUrl: "https://api.jamiiai.com",
    lang: "en"
  };
</script>
<script src="https://cdn.jamiiai.com/widget/jamiiai-widget.js"></script>

Example β€” Pro Plan (French, Left-Positioned)

HTML
<script>
  window.JamiiAIWidget = {
    apiUrl: "https://api.jamiiai.com",
    lang: "fr",
    position: "bottom-left"
  };
</script>
<script src="https://cdn.jamiiai.com/widget/jamiiai-widget.js"></script>

Example β€” Enterprise (White-Label)

HTML
<script>
  window.JamiiAIWidget = {
    apiUrl: "https://api.yourcompany.com",
    plan: "enterprise",
    lang: "fr",
    position: "bottom-left",
    theme: {
      primaryColor: "#0066ff",
      accentColor: "#00ccaa",
      fontFamily: "'Poppins', sans-serif"
    },
    branding: {
      title: "Acme Support",
      subtitle: "We're here to help",
      logo: '<svg viewBox="0 0 32 32"><circle cx="16" cy="16" r="14" fill="#0066ff"/><text x="16" y="21" text-anchor="middle" fill="#fff" font-size="14" font-weight="bold">A</text></svg>',
      showPoweredBy: false
    }
  };
</script>
<script src="https://cdn.jamiiai.com/widget/jamiiai-widget.js"></script>

Self-Hosting

Download jamiiai-widget.js and serve it from your own domain:

HTML
<script>
  window.JamiiAIWidget = {
    apiUrl: "https://api.jamiiai.com"
  };
</script>
<script src="/assets/jamiiai-widget.js"></script>

An optional standalone CSS file (jamiiai-widget.css) is also provided for customers who prefer to host styles separately. The JS file auto-injects styles by default, so the CSS file is not required.

Account Creation & Subscription

Before using the chatbot widget, users must create an account and subscribe to a plan. The website provides a signup form that collects:

  • Full name
  • Email (also used as the username β€” the part before @)
  • Phone
  • Secret question & answer (used for widget login)

After signup the user is redirected to Stripe Checkout to choose a plan (Starter $19/mo, Pro $49/mo, Enterprise $199/mo). On successful payment the subscription is recorded automatically via webhook.

Relevant endpoints

MethodPathDescription
POST/auth/signupCreate a new customer account
POST/auth/subscribeCreate a Stripe Checkout session
POST/auth/stripe-webhookHandle Stripe payment events
GET/auth/stripe-keyRetrieve the Stripe publishable key

API Endpoints Used

On the Pro plan the widget uses three core endpoints. On the Enterprise plan the widget has access to 82 endpoints across 15 modalities β€” the core endpoints below plus those listed in the modality table.

POST /auth/customer/login

Authenticate a user with their email (username) and secret answer.

Request

JSON
{
  "username": "john",
  "secret_answer": "my-secret"
}

Response

JSON
{
  "access_token": "eyJhbGciOi...",
  "token_type": "bearer"
}
POST /chat Bearer

Send a chat message and receive an AI response.

Request

JSON
{
  "message": "What can you do?"
}

Response

JSON
{
  "response": "I can help you with..."
}
POST /chat/reset Bearer

Reset the conversation history and start fresh.

Response

JSON
{
  "message": "Chat reset successfully"
}

Enterprise Modality Endpoints

Enterprise users have a modality selector bar in the widget giving access to all of the following:

ModalityActionsEndpoints
ChatChat, Stream/chat, /chat/stream
CodeGenerate, Review, Explain, Refactor/code/generate, /code/review, /code/explain, /code/refactor
Text AITranslate, Summarize, Sentiment, Extract/text/translate, /text/summarize, /text/sentiment, /text/extract
WebSummarize URL/web/summarize
DatabaseQuery/db/chat
Africa LangChat, Translate, Detect Language/africa/chat, /africa/translate, /africa/detect-language
Africa LifeAgriculture, Education, Legal/africa/agriculture/ask, /africa/education/ask, /africa/legal/ask
Africa CultureProverbs, Storytelling/africa/proverbs/get, /africa/storytelling/tell
AgentTask/agent/task
MemoryStore, Recall, Clear/memory/store, /memory/recall, /memory/clear
Knowledge BaseIngest, Ingest URL, Query, List, Clear/kb/ingest, /kb/ingest-url, /kb/query, /kb/list, /kb/clear
ImageDescribe, Q&A, Generate/image/image-to-text, /image/image-to-answer, /image/text-to-image
DocumentWord, PowerPoint, PDF/document/text-to-word, /document/text-to-powerpoint, /document/text-to-pdf
VoiceSpeech→Text, Text→Speech, Audio Chat/voice/speech-to-text, /voice/text-to-speech, /voice/audio-to-audio
VideoTranscribe, Describe/video/video-to-text, /video/video-to-description

Authentication Flow

  1. User clicks the floating chat button
  2. A login form requests email (username) and secret answer
  3. Credentials are sent to /auth/customer/login, which returns a JWT
  4. The JWT is stored in sessionStorage (cleared on logout or tab close)
  5. All subsequent API calls include the token as Authorization: Bearer
  6. On a 401 response (expired token), the user is returned to the login form

Browser Support

BrowserMinimum Version
Chrome60+
Firefox55+
Safari12+
Edge79+

Troubleshooting

IssueCauseSolution
Chat button doesn't appearScript not loadedVerify the <script> tag path loads without a 404
"API URL not configured" errorMissing apiUrlSet apiUrl in window.JamiiAIWidget before loading the script
"Cannot reach the server"CORS or network issueEnsure your API allows requests from the embedding domain
Login fails with valid credentialsWrong endpointConfirm your API has the /auth/customer/login endpoint
Widget styles conflict with pageCSS specificity clashAll widget classes use the jcb- prefix β€” no collisions expected