Socket
Book a DemoInstallSign in
Socket

@sqliteai/docs-chatbot

Package Overview
Dependencies
Maintainers
5
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sqliteai/docs-chatbot

Documentation search chatbot powered by SQLite and AI

latest
Source
npmnpm
Version
0.1.1
Version published
Weekly downloads
35
-31.37%
Maintainers
5
Weekly downloads
 
Created
Source

@sqliteai/docs-chatbot

Status

Embeddable AI chatbot for documentation, powered by SQLite Cloud.

Quick Start

Prerequisites

Before using this chatbot, you need to:

  • Index your documentation - Use the SQLite AI Search Action to create embeddings from your documentation files
  • Create an edge function - Follow the setup guide to deploy the search edge function

React

npm install @sqliteai/docs-chatbot
import { DocsChatbot } from "@sqliteai/docs-chatbot";
import "@sqliteai/docs-chatbot/style.css";

function App() {
  return (
    <DocsChatbot
      searchUrl="https://yourproject.sqlite.cloud/v2/functions/aisearch-docs"
      apiKey="your-api-key"
      title="Help Center"
    />
  );
}

Vanilla JavaScript

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  </head>
  <body>
    <script src="https://unpkg.com/@sqliteai/docs-chatbot/dist/umd/docs-chatbot.min.js"></script>

    <docs-chatbot
      search-url="https://yourproject.sqlite.cloud/v2/functions/aisearch-docs"
      api-key="your-api-key"
      title="Help Center"
    >
    </docs-chatbot>
  </body>
</html>

Trigger Modes

Default Trigger

Adds a floating button in the bottom-right corner that opens the chatbot when clicked.

<DocsChatbot
  searchUrl="your-edge-function-url"
  apiKey="your-api-key"
  title="Help Center"
/>

Custom Trigger

React:

import { DocsChatbot } from "@sqliteai/docs-chatbot";
import "@sqliteai/docs-chatbot/style.css";
import { useState } from "react";

function App() {
  const [open, setOpen] = useState(false);

  return (
    <>
      {/* Your custom button anywhere in your app */}
      <button onClick={() => setOpen(true)}>Help & Support</button>

      {/* Chatbot with custom trigger mode */}
      <DocsChatbot
        searchUrl="your-edge-function-url"
        apiKey="your-api-key"
        title="Help Center"
        trigger="custom"
        open={open}
        onOpenChange={setOpen}
      />
    </>
  );
}

Vanilla JavaScript:

<script src="https://unpkg.com/@sqliteai/docs-chatbot/dist/umd/docs-chatbot.min.js"></script>

<!-- Your custom button -->
<button id="help-btn">Help & Support</button>

<!-- Chatbot with custom trigger mode -->
<docs-chatbot
  search-url="your-edge-function-url"
  api-key="your-api-key"
  title="Help Center"
  trigger="custom"
>
</docs-chatbot>

<script>
  const chatbot = document.querySelector("docs-chatbot");
  const button = document.getElementById("help-btn");

  // Open chatbot when button is clicked
  button.addEventListener("click", () => {
    chatbot.open = true;
  });

  // Listen to state changes (optional)
  chatbot.addEventListener("openchange", (e) => {
    console.log("Chatbot open:", e.detail.open);
  });
</script>

API Reference

React Component Props

PropertyTypeRequiredDescription
searchUrlstringYesFull URL of your deployed SQLite Cloud edge function (e.g., https://yourproject.sqlite.cloud/v2/functions/aisearch-docs)
apiKeystringYesSQLite Cloud API key with permissions to execute the edge function
titlestringYesTitle displayed in the chatbot header
emptyStateobjectNoCustomizes the initial empty state of the chatbot
emptyState.titlestringNoMain heading shown before the first message
emptyState.descriptionstringNoSubtext shown below the empty state title
trigger"default" | "custom"NoTrigger mode: "default" uses floating button, "custom" requires you to control open state (default: "default")
openbooleanYes when trigger="custom"Control the chatbot open state (only used with trigger="custom")
onOpenChange(open: boolean) => voidYes when trigger="custom"Callback fired when the open state changes (only used with trigger="custom")

Web Component

Attributes

AttributeRequiredDescription
search-urlYesFull URL of your deployed SQLite Cloud edge function (e.g., https://yourproject.sqlite.cloud/v2/functions/aisearch-docs)
api-keyYesSQLite Cloud API key with permissions to execute the edge function
titleYesTitle displayed in the chatbot header
empty-state-titleNoMain heading shown before the first message
empty-state-descriptionNoSubtext shown below the empty state title
triggerNoTrigger mode: "default" uses floating button, "custom" requires controlling open property (default: "default")

Properties

PropertyTypeDescription
openbooleanGet or set the chatbot open state (property-only, no attribute)

Events

EventDetailDescription
openchange{ open: boolean }Fired when the chatbot open state changes

Theming

Customize the chatbot's appearance using CSS variables.

CSS Variables

VariableDescription
--docs-chatbot-radiusBorder radius
--docs-chatbot-backgroundBackground color
--docs-chatbot-foregroundText color
--docs-chatbot-primaryPrimary color
--docs-chatbot-primary-foregroundPrimary text color
--docs-chatbot-secondarySecondary color
--docs-chatbot-secondary-foregroundSecondary text color
--docs-chatbot-mutedMuted color
--docs-chatbot-muted-foregroundMuted text color
--docs-chatbot-accentAccent color
--docs-chatbot-accent-foregroundAccent text color
--docs-chatbot-borderBorder color
--docs-chatbot-inputInput background color
--docs-chatbot-ringFocus ring color
--docs-chatbot-cardCard background color
--docs-chatbot-card-foregroundCard text color
--docs-chatbot-popoverPopover background color
--docs-chatbot-popover-foregroundPopover text color
--docs-chatbot-destructiveDestructive/error color

Examples

React:

/* In your main CSS file, import the chatbot styles first */
@import "@sqliteai/docs-chatbot/style.css";

/* Then override the variables */
:root {
  --docs-chatbot-primary: oklch(0.6 0.2 0);
  --docs-chatbot-primary-foreground: oklch(1 0 0);
  --docs-chatbot-border: oklch(0.85 0 0);
  --docs-chatbot-radius: 8px;
}
import { DocsChatbot } from "@sqliteai/docs-chatbot";
import "./styles.css"; // Your CSS file with overrides

function App() {
  return (
    <DocsChatbot
      searchUrl="your-edge-function-url"
      apiKey="your-api-key"
      title="Help Center"
    />
  );
}

Vanilla JavaScript:

<style>
  docs-chatbot {
    --docs-chatbot-primary: oklch(0.6 0.2 0);
    --docs-chatbot-primary-foreground: oklch(1 0 0);
    --docs-chatbot-border: oklch(0.85 0 0);
    --docs-chatbot-radius: 8px;
  }
</style>

<docs-chatbot
  search-url="your-edge-function-url"
  api-key="your-api-key"
  title="Help Center"
>
</docs-chatbot>

Keywords

chatbot

FAQs

Package last updated on 24 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts