@avatarfirst/core
v0.3.0
Published
Framework-agnostic core for the AvatarFirst SDK -- an "Avatar-as-Interface" toolkit where AI avatars are the primary UI.
Readme
@avatarfirst/core
Framework-agnostic core for the AvatarFirst SDK -- an "Avatar-as-Interface" toolkit where AI avatars are the primary UI.
Architecture
AvatarFirst uses a LiveKit-first architecture. The browser connects to a LiveKit room via WebRTC, and a Python agent server handles all AI orchestration (STT, LLM, TTS, avatar rendering). AFAP container overlays are delivered via LiveKit RPC.
Exports
AvatarFirstClient-- creates LiveKit rooms via the platform APIEventBus<T>-- typed event emitter withon(),emit(),off()OverlayManager-- show/hide/toggle overlay components with lifecycle management- AFAP types -- re-exported from
@avatarfirst/spec(ContainerType,ContainerAction,UserIntent, etc.)
Usage
import { AvatarFirstClient } from '@avatarfirst/core'
const client = new AvatarFirstClient({
apiKey: 'af_live_...',
})
// Creates a LiveKit room and returns { url, token, roomName }
const room = await client.createRoom({ avatarProvider: 'liveavatar' })Most developers should use @avatarfirst/react (or @avatarfirst/vue) instead of using the core directly.
License
MIT
