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

@ephia/transcribe-sdk

v1.1.1

Published

SDK React pour la transcription vocale Ephia (Provider, useTranscription, TranscriptionButton)

Readme

@ephia/transcribe-sdk

SDK React pour la transcription vocale Ephia : bouton d’enregistrement, flux temps réel, contexte React (Provider + useTranscription).

Installation

npm install @ephia/transcribe-sdk

Prérequis

  • Contexte sécurisé (HTTPS ou localhost) pour l’accès au microphone.
  • Importer les styles du SDK (obligatoire) : @ephia/transcribe-sdk/dist/styles.css
  • Fichier audio-processor.js (obligatoire) : le SDK charge par défaut /audio-processor.js. Vous devez donc servir ce fichier depuis vos assets statiques.

Installer le worklet audio-processor.js

Après npm install, copiez le worklet depuis node_modules vers vos assets statiques.

  • Vite / CRA / tout projet avec dossier public/ :
cp node_modules/@ephia/transcribe-sdk/dist/audio-processor.js public/audio-processor.js
  • Next.js :
cp node_modules/@ephia/transcribe-sdk/dist/audio-processor.js public/audio-processor.js

Si vous ne pouvez pas copier de fichier, vous pouvez aussi héberger ce worklet ailleurs et passer audioProcessorUrl.

Utilisation

  1. Enveloppez votre app (ou la partie qui utilise la transcription) avec TranscriptionProvider.
  2. Passez un token (clé API) au TranscriptionButton. Créez une clé sur plateform.ephia.app/api-keys.
  3. Utilisez useTranscription() pour lire l’état (chunks, isRecording, etc.) où vous voulez dans l’arbre.
import { TranscriptionProvider, TranscriptionButton, useTranscription } from '@ephia/transcribe-sdk';
import '@ephia/transcribe-sdk/dist/styles.css';

function MyApp() {
  return (
    <TranscriptionProvider>
      <TranscriptionButton token="YOUR_API_TOKEN" />
      <TranscriptDisplay />
    </TranscriptionProvider>
  );
}

function TranscriptDisplay() {
  const { chunks } = useTranscription();
  return <div>{chunks.map(c => <p key={c.id}>{c.text}</p>)}</div>;
}

Next.js (App Router)

Le bouton utilise le micro, donc il doit être rendu côté client. Dans Next.js, placez-le dans un composant avec :

"use client";

Props principales

  • token (requis) : clé API Ephia.
  • streamingUrlBase : URL de base WebSocket (défaut : NEXT_PUBLIC_WS_URL, sinon ws://localhost:8765 sur localhost, sinon wss://api-platform.ephia.app).
  • audioProcessorUrl : URL du worklet (défaut : /audio-processor.js).
  • interimStreaming : si true, transcriptions intermédiaires Whisper ; si false, attente du final par segment (défaut : false).
  • finalReformat : si true, après la fin de dictée le serveur envoie un texte unique reformatté (Groq) via l’événement WebSocket session_reformat_final, puis final_sync comme d’habitude. Les chunks sont alors remplacés par un seul chunk session_reformat_final (défaut : false).
  • theme, variant, size : apparence du bouton.

Relecture finale et warnings

  • En cas d’échec ou de timeout de la relecture, le serveur peut envoyer un message warning : le SDK expose le dernier événement dans useTranscription().streamingWarning (code, message), sans passer par error. Les segments finaux restent disponibles dans chunks tant que le remplacement par session_reformat_final n’a pas eu lieu.

Exemple “prod” pour le WebSocket

<TranscriptionButton
  token="YOUR_API_TOKEN"
  streamingUrlBase="wss://api-platform.ephia.app"
/>

Dépannage (rapide)

  • Erreur / 404 sur /audio-processor.js : copiez bien node_modules/@ephia/transcribe-sdk/dist/audio-processor.js vers public/audio-processor.js (ou passez audioProcessorUrl).
  • Micro bloqué : utilisez HTTPS (ou http://localhost) et acceptez la permission micro dans le navigateur.
  • WebSocket KO : vérifiez streamingUrlBase (doit être ws:// en local, wss:// en prod) et que votre backend expose bien /api/v2/streaming/live.
  • Bouton “sans style” : vérifiez l’import @ephia/transcribe-sdk/dist/styles.css.

Licence

Propriétaire. Voir le fichier LICENSE fourni avec le package.