# Copilot Ld Copilot Ld Libchat

> libchat Skill

- Skill: `tomevault-io/copilot-ld-copilot-ld-libchat` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/copilot-ld-copilot-ld-libchat`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/copilot-ld-copilot-ld-libchat/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/copilot-ld-copilot-ld-libchat

---


# libchat Skill

## When to Use

- Embedding chat interfaces in web applications
- Building dedicated chat page experiences
- Adding conversational AI to existing websites
- Creating custom chat UI with authentication

## Key Concepts

**ChatClient**: Composed client managing auth state, API communication, and
conversation persistence via localStorage.

**ChatDrawerElement**: Collapsible drawer component for unobtrusive chat
integration on any page.

**ChatPageElement**: Full-page chat component for dedicated chat experiences.

## Usage Patterns

### Pattern 1: Embed chat drawer

```javascript
import { ChatClient, ChatDrawerElement } from "@copilot-ld/libchat";

const client = new ChatClient({
  chatUrl: "/web/api/chat",
  auth: { url: "http://localhost:9999", anonKey: "key" },
});

document.querySelector("chat-drawer").client = client;
```

### Pattern 2: Full-page chat

```html
<chat-page data-name="Assistant"></chat-page>
<script type="module">
  import { ChatClient, ChatPageElement } from "@copilot-ld/libchat";
  const client = new ChatClient({ chatUrl: "/api" });
  document.querySelector("chat-page").client = client;
</script>
```

## Integration

Used by the UI extension. Communicates with Web extension chat API.

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/copilot-ld) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

