# 🧠 Xena SDK — Embed AI Agents into Any Web Platform

[![npm version](https://img.shields.io/npm/v/xena-sdk.svg)](https://www.npmjs.com/package/xena-sdk)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
[![Build Status](https://img.shields.io/github/actions/workflow/status/your-org/xena-sdk/ci.yml)](https://github.com/your-org/xena-sdk/actions)

> **Xena SDK** is a powerful, plug-and-play SDK that lets you embed conversational AI agents into **any website or web application** in minutes. Enable intelligent conversations, automate workflows, and enhance user engagement with ease.

---

## 🚀 Features

- ⚡️ **Lightweight & Fast** — Designed for quick embedding with minimal setup.
- 🧠 **AI-Powered** — Backed by powerful LLMs for human-like conversation.
- 🎨 **Customizable UI** — Change colors, avatars, and prompts to match your brand.
- 🔌 **Platform Agnostic** — Works on any frontend (React, Vue, Angular, or plain HTML).
- 🔒 **Secure & Scalable** — Optimized for production deployments.
- 🪄 **Event Hooks & API Integration** — Easily connect to your internal tools or APIs.
- 📦 **CDN or NPM Ready** — Load via script tag or install via npm.

---

## 📦 Installation

### Option 1: Using npm/yarn

```bash
npm install @xenara/xena-sdk
# or
yarn add @xenara/xena-sdk
```

### Option 2: Using CDN

```html
<script src="https://widget.xenara.ai/dist/widget.js"></script>
```

---

## 🛠️ Usage

### Basic Setup (with npm)

```javascript
import { Xena } from "@xenara/xena-sdk";

Xena.init({
  containerId: "your-container-id",
  apiKey: "your-api-key",
  user_id: "unique-user-id", // Optional, for user-specific data
  name: "User name", // Optional, for personalized greetings
  email: "user@example.com", // Optional, for user-specific data
  created_at: "2023-10-01T00:00:00Z", // Optional, to capture the user's sign-up date
});
```

### HTML Example (via CDN)

```html
<div id="xena-container"></div>
<script src="https://widget.xenara.ai/dist/widget.js"></script>
<script>
  window.Xena.init({
    containerId: "your-container-id",
    apiKey: "your-api-key",
    user_id: "unique-user-id", // Optional, for user-specific data
    name: "User name", // Optional, for personalized greetings
    email: "user@example.com", // Optional, for user-specific data
    created_at: "2023-10-01T00:00:00Z", // Optional, to capture the user's sign-up date
  });
</script>
```

---

## 🎨 Customization

You can pass the following options to `init()`:

| Option        | Type     | Description                         |
| ------------- | -------- | ----------------------------------- |
| `containerId` | `string` | DOM ID to mount the chat widget     |
| `apiKey`      | `string` | Unique key for your AI agent        |
| `user_id`     | `string` | Unique user identifier (optional)   |
| `name`        | `string` | User's name for personalized greetings (optional) |
| `email`       | `string` | User's email for personalized data (optional) |
| `created_at`  | `string` | User's sign-up date in ISO format (optional) |

---

## 🔌 Integrations

Xena SDK can be integrated with:

- 🔗 Your internal APIs (e.g., for FAQs, user data, transactions)
- 💬 Backend chat engines or ML endpoints
- 📈 Analytics tools like Google Analytics or Mixpanel

---

## 🧩 Future Roadmap

- [ ] Voice input/output
- [ ] Multi-agent support
- [ ] Chat memory and history sync
- [ ] Plugin system for adding skills
- [ ] Mobile SDKs

---

## 🤝 Contributing

We welcome contributions! Please read our [contribution guide](CONTRIBUTING.md) before submitting a pull request.

---

## 📄 License

This project is licensed under the [MIT License](LICENSE).

---

## 🌐 Links

- [Website](https://xena.ai/)
- [NPM Package](https://www.npmjs.com/package/xena-sdk)
- [Docs](https://docs.xena.ai/)
- [Community](https://discord.gg/xena)
