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

@telenow/react

v0.1.3

Published

React hook for Telenow voice AI — useVoiceCall() adds real-time AI voice agent calls to your app: call state, live transcripts, mute, chat messages, barge-in, auto-reconnect.

Downloads

456

Readme

@telenow/react

React hook for Telenow voice AI — useVoiceCall() puts a real-time AI voice agent call behind plain React state. The underlying @telenow/client engine handles the mic, echo/noise suppression, jitter-buffered playback, barge-in, reconnect, and transcripts. You render buttons and text.

npm install @telenow/react @telenow/client react

Before you start

  1. A Telenow account + agent (dashboard → Agents).
  2. Authorization for the call, one of:
    • Backend-minted session (recommended) — your server calls calls.createWeb() (@telenow/server) or init_web_call() (Python) with an org API key and returns { sessionId, websocketUrl }. No credential in the browser.
    • publicSlug — the agent's published slug (Publish tab), no backend.
  3. Serve over https:// (or localhost) — required for mic access — and call start() from a click (autoplay policy).

Quickstart

import { useVoiceCall } from '@telenow/react';

function CallPanel({ session }: { session: { sessionId: string; websocketUrl: string } }) {
  const { state, transcript, muted, error, start, stop, mute, sendText } = useVoiceCall({
    session,                          // or: publicSlug: 'my-agent'
  });

  return (
    <div>
      <button onClick={state === 'live' ? stop : start} disabled={state === 'connecting'}>
        {state === 'live' ? 'End call' : state === 'connecting' ? 'Connecting…' : 'Start call'}
      </button>

      {state === 'live' && (
        <button onClick={() => mute(!muted)}>{muted ? 'Unmute' : 'Mute'}</button>
      )}
      {state === 'reconnecting' && <span>Reconnecting…</span>}
      {error && <p role="alert">{error}</p>}

      <ul>
        {transcript.map((t, i) => (
          <li key={i} style={{ opacity: t.isFinal ? 1 : 0.6 }}>
            <b>{t.role}:</b> {t.text}
          </li>
        ))}
      </ul>
    </div>
  );
}

The hook tears the call down automatically when the component unmounts.

API

Options (UseVoiceCallOptions)

| Option | Type | Notes | |---|---|---| | session | { sessionId, websocketUrl } | Backend-minted session — skips init in the browser (recommended). | | publicSlug | string | Published agent, no auth. | | token | string | Ephemeral client token (Authorization: Bearer). | | baseUrl | string | API origin when the hook does its own init (default same-origin). | | variables | Record<string,string> | Context variables; required ones must be present. | | audio | { encoding?, targetSampleRate?, echoCancellation?, noiseSuppression?, autoGainControl? } | Defaults: μ-law 8 kHz, AEC + NS on, AGC off. Keep them. | | turnTaking | 'duplex' \| 'halfDuplex' | 'duplex' (default) = barge-in enabled, like the dashboard test call. 'halfDuplex' = mic gated while the agent speaks — for devices without echo cancellation (emulators, loud speakers). | | reconnect | { maxAttempts?, baseDelayMs?, maxDelayMs?, jitter? } | Default 6 attempts, 0.5 s → 10 s, ±30 % jitter. |

Returns

| Field | Type | Meaning | |---|---|---| | state | 'idle' \| 'connecting' \| 'live' \| 'reconnecting' \| 'ended' \| 'error' | Drive your whole UI off this. | | transcript | { role, text, isFinal }[] | Live lines for user and assistant; non-final lines update as speech continues. | | muted | boolean | Current mic state. | | error | string \| null | Last failure (state will be 'error'). | | start | () => Promise<void> | Ask mic permission, connect, go live. Safe to call when already live (no-op). | | stop | () => void | Hang up. | | mute | (m: boolean) => void | Toggle the mic. | | sendText | (text, { chat? }) => boolean | Typed user turn; { chat: true } requests a text-only reply (chat mode). Returns false if the socket isn't open. |

Troubleshooting

  • start rejects / error set — check the session/slug/token: 401–403 = bad credential or API access disabled on the agent's Publish tab; 400 naming a variable = a required context variable is missing.
  • No mic prompt — page isn't https:///localhost.
  • No audio until interaction — call start() from a click handler.
  • The agent hung up — that's state === 'ended' via the server's session_end; no action needed.

What is Telenow?

Telenow is a voice AI platform for building production-grade phone and web agents. Pick a brain from the built-in LLM/STT/TTS providers (or bring your own model and carrier), give the agent a prompt, tools, and knowledge, and put it on a phone number, your website, or your app. Every call comes with recordings, transcripts, analytics, warm transfer to humans, outbound campaigns, and webhooks.