# Kapa React SDK

[![npm version](https://img.shields.io/npm/v/@kapaai/react-sdk.svg)](https://www.npmjs.com/package/@kapaai/react-sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

> Build AI-powered chat interfaces that answer questions from your knowledge base.

## What is Kapa.ai?

[kapa.ai](https://kapa.ai) is a platform that turns your documentation, knowledge base, and support content into an AI assistant. It enables your users to get instant, accurate answers drawn directly from your own content.

## SDK Overview

This React SDK allows you to easily integrate Kapa-powered chat functionality into your React applications. Add a few components to your app and give your users the ability to chat with an AI that knows your product.

## Quick Links

- [📚 Official Documentation](https://docs.kapa.ai/dev/sdk/)
- [💻 Demo Repository](https://github.com/kapa-ai/react-sdk-demo)

## Installation

```bash
npm install @kapaai/react-sdk
```

## Basic Usage

```jsx
import { KapaProvider, useChat } from "@kapaai/react-sdk";

// Wrap your app with the provider
function App() {
  return (
    <KapaProvider integrationId="your-integration-id">
      <YourChatInterface />
    </KapaProvider>
  );
}

// Use the hook in your components
function YourChatInterface() {
  const { conversation, submitQuery, isGeneratingAnswer } = useChat();

  // Build your chat UI...
}
```

For detailed usage instructions and API reference, see the [official documentation](https://docs.kapa.ai/dev/sdk/).
