# CLAUDE
Source: https://docs.mascot.bot/CLAUDE
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Project Overview
This is the documentation site for Mascotbot SDK, built with Mintlify - a modern documentation framework. The site documents the Mascotbot AI-powered mascots SDK with real-time lip-sync technology for React and React Native applications.
## Development Commands
```bash theme={null}
# Install Mintlify CLI globally (required for development)
npm i -g mintlify
# Run development server locally
mintlify dev
# If dev server fails to start
mintlify install
```
## Architecture & Structure
### Technology Stack
* **Documentation Framework**: Mintlify with MDX support
* **Theme**: Maple theme with light/dark mode
* **API Documentation**: OpenAPI 3.1.0 specification
* **Content Format**: MDX (Markdown + JSX components)
### Directory Structure
* `/api-reference/` - API documentation and OpenAPI spec
* `openapi.yaml` - Viseme Prediction API specification
* `endpoint/` - Individual endpoint documentation
* `lipsync-integration.mdx` - Integration examples
* `/libraries/` - SDK documentation
* `react-sdk.mdx` - React SDK guide with WebGL2 renderer
* `react-native-sdk.mdx` - React Native SDK guide
* `/mascots/` - Pre-built mascot gallery
* `/images/` - Documentation assets and screenshots
* `/logo/` - Brand assets (light/dark variants)
### Navigation Configuration
The site has two main dropdown sections configured in `docs.json`:
1. **Documentation** - Getting started, SDK libraries, ready-made mascots
2. **API Reference** - API introduction, endpoints, integration examples
## Key Development Tasks
### Adding Documentation Pages
1. Create MDX file in appropriate directory
2. Add frontmatter with title, description, and icon
3. Update navigation in `docs.json` under appropriate group
4. Preview locally with `mintlify dev`
### Updating API Documentation
1. Modify `api-reference/openapi.yaml` for API spec changes
2. Update endpoint MDX files in `api-reference/endpoint/`
3. Ensure examples match the OpenAPI specification
### Working with Code Examples
* Use proper language identifiers for syntax highlighting
* Include complete, runnable examples
* Test code examples for accuracy
* Show both TypeScript and JavaScript variants where applicable
### Testing Changes
1. Always preview with `mintlify dev` before committing
2. Check both light and dark theme appearance
3. Verify all links and images load correctly
4. Test interactive MDX components render properly
5. Ensure responsive design works on mobile viewports
## Content Guidelines
### MDX Best Practices
* Use semantic headings (start with ##, not #)
* Include descriptive frontmatter for SEO
* Use Mintlify components: Note, Warning, Tip, Info callouts
* Add code examples with proper syntax highlighting
* Include screenshots and diagrams where helpful
### API Documentation Standards
* Keep OpenAPI spec synchronized with actual API
* Document all parameters, request/response bodies
* Include realistic example values
* Document error responses and status codes
* Show streaming (SSE) examples for real-time endpoints
### SDK Documentation Focus
* Provide complete setup instructions
* Show common use cases with code examples
* Document all hooks and components
* Include troubleshooting sections
* Explain performance considerations (e.g., WebGL2 renderer)
## Important Notes
* The main branch auto-deploys via GitHub App integration
* Mintlify provides built-in search functionality
* External links configured: support email, Twitter/X, main website
* The site uses contextual menu with copy, view, ChatGPT, and Claude options
* Focus on accuracy - this is the primary resource for developers using Mascotbot SDK
# Changelog
Source: https://docs.mascot.bot/changelog
Product updates, new features, and improvements
## SDK 0.2.3 — interactive avatar SDK, offline timelines, unified streaming
The SDK is now two packages — `@mascotbot/core` and `@mascotbot/react` — a single composable surface for real-time interactive avatars. Continuously-updated models and assets are delivered from Mascotbot; you ship the avatar. The documentation has been rewritten end to end for the new surface.
* **Real-time pipeline** — audio in, animated avatar out; one composable surface.
* **Serializable offline timeline** — `processAudio()` returns a versioned `VisemeTimeline`. Persist it as JSON and replay later with zero reprocessing via `parseTimeline` + `setTimeline`.
* **One streaming hook** — `useLipsyncStream` handles live audio with `source: mic | mediaStream | manual`.
* **Realtime, your way** — wire OpenAI Realtime, Gemini Live, or ElevenLabs with their own SDKs and tap the audio; `createPCMStreamPlayer` plays raw-PCM providers and exposes the tap.
* **Focused Rive surface** — `useMascotRive` + `useMascotInputs` (with `has()`); the SDK writes only mouth, `is_speaking`, and `stress` — everything else stays yours.
* **Private registry install** — `npm.mascot.bot` with an `.npmrc` token; `mascot_dev_…` for localhost, `mascot_pub_…` for production.
Upgrading an existing integration? The [migration guide](https://docs.mascot.bot/reference/migration) maps every change.
[Read the docs →](https://docs.mascot.bot/overview)
## Ship your agent on your own domain
Attach a subdomain or apex to any hosted agent, then set a per-agent page title, description, OG preview, and favicon so shared links look like yours — not ours.
* Custom domain attach via the Vercel Domains API — paste the hostname, copy one DNS record, we auto-poll and verify the moment propagation lands.
* Per-agent SEO: ``, description, OG image, favicon — with a live Slack / Twitter / browser-tab preview right next to the inputs.
* Works for both standalone and widget-hosted agents, subdomain or apex.
[Try it →](https://app.mascot.bot/agents)
## A lipsync playground against real voice streams
The new [`/lipsync-test`](https://www.mascot.bot/lipsync-test) tool lets you upload any Rive mascot, wire a Gemini Live session or plug in your own ElevenLabs agent, and dial every SDK knob — critical-viseme holds, min intervals, transition speeds — while the mascot responds in real time.
* Switch providers on the fly: **Gemini Live** (preset) or paste your own ElevenLabs API key + agent ID — credentials stay in your browser.
* Every `NaturalLipSyncConfig` field is a live slider; changes apply mid-call without resetting playback.
* Chip selector for the critical viseme set (r, l, f/v, p/b/m by default; toggle any of 21 to taste).
* Replay captured responses against tweaked settings to A/B feel without re-speaking.
* Upload any `.riv` file to test your own mascot; HD-zoom + pan the canvas to inspect mouth shapes.
[Try it →](https://www.mascot.bot/lipsync-test)
## Tune your mascot's lipsync mid-call, without reset
Mascotbot SDK `0.2.0` adds critical-viseme holds, a configurable critical set, and a live-update pipeline — every phoneme knob now takes effect on the next viseme chunk, mid-call, without breaking the stream.
* `criticalVisemeMinDuration` holds u/o/r/l/f/v/p/b/m phonemes long enough to register, dropping any non-critical viseme that would interrupt the hold window.
* `criticalVisemeIds` exposes the critical set — drop vowels, add sibilants, whatever fits your character. Exports `DEFAULT_CRITICAL_VISEME_IDS` for consumers to derive custom lists.
* `desktopTransitionSpeed` / `mobileTransitionSpeed` set the mouth-blend rate; default bumped from `11` → `22` for snappier blends.
* Config edits now flow through the active `MascotPlayback` in place; slider tweaks and preset changes don't tear down the stream.
* Rive runtime bumped to `@rive-app/react-webgl2@4.28.1` / `@rive-app/webgl2@2.37.2` — latest upstream fixes and perf work on the WebGL2 renderer.
* Perf tuning validated on [`/lipsync-test`](https://www.mascot.bot/lipsync-test): memoized side panels, ref-based viewport pan/zoom, identity short-circuit on per-chunk config sync, NoiseOverlay visibility gate.
[Download →](https://app.mascot.bot/sdk-access)
## Clone a persistent voice AI agent for React and deploy in 30 minutes
The new `react-website-demo` template is a Next.js 16 starter with an ElevenLabs voice widget that survives every page navigation — no re-init, no lost context — plus a companion tutorial that walks through the Context + Router pattern behind it.
* **Persistent across every route** — voice session lives in a React Context singleton, so conversations don't die when users click to a new page
* **Three client tools wired out of the box** — the agent reads/writes your form, routes between pages, and triggers CTAs
* **Full stack** — Next.js 16, React 19, TypeScript, ElevenLabs Conversational AI 0.5, MascotBot SDK 0.1.9
* **\<300ms voice latency · 30–45 min setup** — clone, set three env vars, one-click deploy to Vercel
* **Companion tutorial** walks through the Context + Router pattern so you can adapt it to any React app
[Read more →](https://templates.mascot.bot/voice-ai-agent-react-tutorial)
## Drop a voice avatar onto any website with one line of HTML
Design your widget visually in the dashboard — size, paddings, mobile overrides, custom button label — then paste a single `