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

@liforma/client

v0.4.12

Published

Liforma browser SDK — Experience sessions, speech API, and Svelte embed component.

Readme

@liforma/client

Browser SDK for Liforma — embed real-time AI avatar experiences in web apps.

Experience (exp_…) → Session Manifest → @liforma/client

Docs: docs.liforma.ai · Quick start · llms.txt
Examples: examples.liforma.ai
Portal (API keys & origins): app.liforma.ai

Install

npm install @liforma/client

Optional peers: svelte ^5 for the Svelte entry; react / react-dom ^18 or ^19 for React / Next; @elevenlabs/client for /elevenlabs; livekit-client for /livekit. /openai, /deepgram, and /google use the browser WebSocket API (no extra peer). Shared BYO primitives live in @liforma/client/byo (used by the vendor helpers; rarely imported directly).

Hello world

Svelte

<script>
  import { Experience } from '@liforma/client/svelte';
</script>

<Experience experienceId="exp_01EXAMPLES_COFFEE_BARISTA" />

Gallery cards — use the light thumbnail entry so landing pages do not load the session SDK:

<script>
  import { ExperienceThumbnail } from '@liforma/client/svelte/thumbnail';
</script>
import { ExperienceThumbnail } from '@liforma/client/react/thumbnail';
// or: import { ExperienceThumbnail } from '@liforma/client/next/thumbnail';
<script src="https://cdn.liforma.ai/sdk/v2/thumbnail.js" defer></script>
<liforma-experience-thumbnail experience-id="exp_…" alt="…"></liforma-experience-thumbnail>

React

import { Experience } from '@liforma/client/react';

export function Demo() {
  return <Experience experienceId="exp_01EXAMPLES_COFFEE_BARISTA" />;
}

Next.js (App Router session route)

import { createLiformaSessionRouteHandler } from '@liforma/client/next';

export const POST = createLiformaSessionRouteHandler({
  // Production: supply authorize() that checks your app session.
  allowUnauthenticated: true // demos only
});
'use client';

import { Experience } from '@liforma/client/next';

export function Demo() {
  return (
    <Experience
      experienceId="exp_01EXAMPLES_COFFEE_BARISTA"
      sessionEndpoint="/api/liforma-session"
    />
  );
}

Vanilla (CDN)

<script src="https://cdn.liforma.ai/sdk/v2/client.js" defer></script>
<liforma-experience experience-id="exp_01EXAMPLES_COFFEE_BARISTA"></liforma-experience>

Package entry points

| Import | Surface | |--------|---------| | @liforma/client | JS API (Experience.startSession, types) | | @liforma/client/svelte | <Experience />, <ExperienceThumbnail />, <ExperienceWidget /> | | @liforma/client/svelte/thumbnail | <ExperienceThumbnail /> only (prefer for galleries) | | @liforma/client/thumbnail | Shared thumbnail helpers (no session player) | | @liforma/client/react | React components | | @liforma/client/react/thumbnail | <ExperienceThumbnail /> only (prefer for galleries) | | @liforma/client/next | Next helpers + client components | | @liforma/client/next/thumbnail | <ExperienceThumbnail /> only (prefer for galleries) | | @liforma/client/byo | Shared BYO primitives (PCM/mic/turn helpers) | | @liforma/client/elevenlabs | connectElevenLabsAgent (BYO ElevenLabs Agents → avatar) | | @liforma/client/openai | connectOpenAiRealtime / connectOpenAiRealtimeWebRtc (BYO OpenAI Realtime → avatar) | | @liforma/client/deepgram | connectDeepgramAgent (BYO Deepgram Voice Agent → avatar) | | @liforma/client/google | connectGeminiLive (BYO Gemini Live → avatar) | | @liforma/client/livekit | connectLiveKitAgent (BYO LiveKit remote track → avatar) | | CDN sdk/v2/client.js | Web components + window.Liforma | | CDN sdk/v2/thumbnail.js | <liforma-experience-thumbnail> only |

Session minting

| Situation | Path | |-----------|------| | You have a backend | Mint with API key via POST /v1/sessions; pass a same-origin sessionEndpoint to the component | | Client-only / public demos | Allowlist your origin in the developer portal; the SDK mints via POST /v1/public-sessions |

Never put API keys in browser code. Details: Server sessions, Browser embeds.

Speech API

import { Experience } from '@liforma/client';

const experience = await Experience.startSession({ experienceId: 'exp_…' });
await experience.attach({ container: '#avatar' });

experience.on('started', async () => {
  // Liforma TTS
  await experience.speech.speak({ text: 'Hello from Liforma.' });

  // Bring-your-own: PCM, encoded bytes, URL, or MediaStreamTrack
  await experience.speech.play({
    audio: { url: 'https://cdn.example.com/line.mp3' },
    queue: 'append'
  });

  // Vendor BYO helpers (install optional peers as needed):
  // import { connectElevenLabsAgent } from '@liforma/client/elevenlabs';
  // import { connectOpenAiRealtime } from '@liforma/client/openai';
  // import { connectDeepgramAgent } from '@liforma/client/deepgram';
  // import { connectGeminiLive } from '@liforma/client/google';
  // import { connectLiveKitAgent } from '@liforma/client/livekit';
});

| Capability | Methods | |------------|---------| | textSpeech | speech.speak | | externalSpeechAudio | speech.play, speech.createUtterance, speech.interrupt |

Streaming vendors: open one utterance per agent turn, write PCM chunks, close on turn end — see Bring your own voice.

More components

License

MIT