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

@satish-bohra/client

v1.0.1

Published

MyriadAI client RTC for AI voice calls

Readme

@myriadai/client

MyriadAI Client is a web rtc for managing real-time AI voice calls and transcripts. This package provides a simplified API for React or other frontend applications.


Installation


npm install @myriadai/client

or using Yarn:

yarn add @myriadai/client

Features

Initialize AI voice call sessions

Join and leave calls easily

Mute and unmute audio

Get real-time status updates (idle, listening, speaking, etc.)

Access live transcripts via a callback

Usage

Basic Example:

import { MyriadAISession } from "@myriadai/client";

//Initialize session
const session = new MyriadAISession();

//Listen to status changes
session.onStatusChange = (status) => {
console.log("Session status:", status);
};

//Listen to transcript updates
session.onTranscript = (transcripts) => {
console.log("Transcripts:", transcripts);
};

//Join a call
session.joinCall("YOUR_CALL_URL");

//Leave the call
session.leaveCall();

//Mute / Unmute
session.mute();
session.unmute();

Methods

| Method | Description | | --------------- | ---------------------------------- | | joinCall(url) | Join a call with the provided URL. | | leaveCall() | Leave the current call. | | mute() | Mute the local microphone. | | unmute() | Unmute the local microphone. |

Callbacks

| Callback | Description | | ---------------- | ---------------------------------------------------------------------------------------------------------------------- | | onStatusChange | Fires whenever the session status changes. Receives status string. | | onTranscript | Fires whenever new transcripts are available. Receives an array of transcripts: { speaker: string, text: string }[]. |

React Example

Here is a minimal React component using MyriadAISession:


import React, { useEffect, useRef, useState } from "react";
import { MyriadAISession } from "@myriadai/client";

const MyriadaiRTC = ({ callUrl }) => {
  const [status, setStatus] = useState("idle");
  const [transcripts, setTranscripts] = useState([]);
  const sessionRef = useRef(null);

  useEffect(() => {
    const session = new MyriadAISession();
    sessionRef.current = session;

    // Attach callbacks
    session.onStatusChange = setStatus;
    session.onTranscript = setTranscripts;

    // Join call if URL provided
    if (callUrl) session.joinCall(callUrl);

    return () => {
      session.leaveCall();
      sessionRef.current = null;
    };
  }, [callUrl]);

  return (
    <div>
      <h3>Session Status: {status}</h3>
      <div>
        <h4>Transcripts:</h4>
        <ul>
          {transcripts.map((t, i) => (
            <li key={i}>
              <strong>{t.speaker}</strong>: {t.text}
            </li>
          ))}
        </ul>
      </div>
      <div>
        <button onClick={() => sessionRef.current?.mute()}>Mute</button>
        <button onClick={() => sessionRef.current?.unmute()}>Unmute</button>
        <button onClick={() => sessionRef.current?.leaveCall()}>Disconnect</button>
      </div>
    </div>
  );
};

export default MyriadaiRTC;

or (TypeScript / React)


import React, { useEffect, useRef, useState } from "react";
import { MyriadAISession, Transcript } from "@myriadai/client";

interface MyriadaiRTCProps {
  callUrl: string;
}

const MyriadaiRTC: React.FC<MyriadaiRTCProps> = ({ callUrl }) => {
  const [status, setStatus] = useState<string>("idle");
  const [transcripts, setTranscripts] = useState<Transcript[]>([]);
  const sessionRef = useRef<MyriadAISession | null>(null);

  useEffect(() => {
    const session = new MyriadAISession();
    sessionRef.current = session;

    session.onStatusChange = (newStatus: string) => setStatus(newStatus);
    session.onTranscript = (newTranscripts: Transcript[]) => setTranscripts(newTranscripts);

    if (callUrl) {
      session.joinCall(callUrl);
    }

    return () => {
      session.leaveCall();
      sessionRef.current = null;
    };
  }, [callUrl]);

  return (
    <div>
      <h3>Session Status: {status}</h3>
      <div>
        <h4>Transcripts:</h4>
        <ul>
          {transcripts.map((t, i) => (
            <li key={i}>
              <strong>{t.speaker}</strong>: {t.text}
            </li>
          ))}
        </ul>
      </div>
      <div>
        <button onClick={() => sessionRef.current?.mute()}>Mute</button>
        <button onClick={() => sessionRef.current?.unmute()}>Unmute</button>
        <button onClick={() => sessionRef.current?.leaveCall()}>Disconnect</button>
      </div>
    </div>
  );
};


export default MyriadaiRTC;

Transcript Type

interface Transcript { speaker: string; // "agent" or "user" text: string; // transcript text }