npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@animated-waffle/client

v0.2.6

Published

Framework-independent browser SDK for Narya Animated Waffle talking Agents.

Downloads

1,283

Readme

@animated-waffle/client

Framework-independent browser SDK for embedding a published Narya talking Agent: connection lifecycle, microphone input, text input, state, and transcripts. React applications should use @animated-waffle/react, which re-exports this entire API and adds the Avatar renderer.

The Agent owns its avatar, voice, and prompt. Pipecat, Daily, API routes, and avatar asset URLs are SDK implementation details. Production is the default API origin; tests and non-production integrations may pass apiOrigin.

Connect

Keep the permanent workspace API key on your server. Exchange it for a short-lived Agent session token and give the browser a callback that obtains one for each connection:

import { WaffleClient } from '@animated-waffle/client'

const agentId = '22222222-2222-4222-8222-222222222222'
const endUserId = '55555555-5555-4555-8555-555555555555'
const waffle = new WaffleClient({
  agentId,
  // Set false for text-triggered, output-only applications.
  inputAudioEnabled: false,
  sessionToken: async () => {
    const response = await fetch('/api/narya-session-token', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ agentId, endUserId }),
    })
    const body = await response.json()
    return body.token
  },
})

waffle.on('transcript', ({ id, role, text, final }) => {
  // Completed Narya conversation rows use the same id as persisted history.
  if (final) console.log(id, role, text)
})

await waffle.connect()

endUserId is one stable bare UUID per end user. An anonymous application can generate it once with crypto.randomUUID() and persist it on that device.

To target a non-production environment:

const waffle = new WaffleClient({
  agentId,
  sessionToken: () => getSessionToken(agentId),
  apiOrigin: 'https://animated-waffle-dev.narya.ai',
})

API surface

  • connect({ inputMode? })'push-to-talk' (default) or 'automatic'.
  • inputAudioEnabled: false — never requests or enables the browser microphone; text input, Agent audio, transcripts, and reconnects continue to work. Push- to-talk controls fail closed with input_audio_disabled. The default is true, enabled only after the Agent is ready.
  • muted — silences the Agent's voice while it keeps performing: the session, the transcript and the Avatar's cues carry on, only playback goes quiet.
  • audioPlayback: false — the client builds no audio element of its own. Play remoteAudioTrack yourself; an application that routes the voice through its own element, mixer or Web Audio graph must turn this off, or the voice is heard twice. muted then has nothing to do.
  • disconnect(), sendText(text).
  • startPushToTalk() / commitPushToTalk() / cancelPushToTalk().
  • on('status' | 'session' | 'transcript' | 'agentSpeaking' | 'error', fn) — returns the unsubscribe function.
  • Conversation transcripts carry the same required id as persisted history. Provider sentence/progress framing never defines a public conversation row.
  • status, session getters; failures throw WaffleError with code.

./internal is a private contract consumed by @animated-waffle/react; it is not part of the public API and may change without notice.

See the SDK documentation for the complete integration guide.