use-scribe
elevenlabs/use-scribeFreeHook
shadcn/ui publishes no description for this item.
Install it
npx shadcn@latest add https://raw.githubusercontent.com/elevenlabs/ui/main/apps/www/public/r/use-scribe.jsonSource
1"use client"23import { useCallback, useEffect, useRef, useState } from "react"4import { RealtimeEvents, Scribe } from "@elevenlabs/client"5import type {6 AudioFormat,7 AudioOptions,8 CommitStrategy,9 CommittedTranscriptMessage,10 CommittedTranscriptWithTimestampsMessage,11 MicrophoneOptions,12 PartialTranscriptMessage,13 RealtimeConnection,14 ScribeAuthErrorMessage,15 ScribeChunkSizeExceededErrorMessage,16 ScribeCommitThrottledErrorMessage,17 ScribeErrorMessage,18 ScribeInputErrorMessage,19 ScribeInsufficientAudioActivityErrorMessage,20 ScribeQueueOverflowErrorMessage,21 ScribeQuotaExceededErrorMessage,22 ScribeRateLimitedErrorMessage,23 ScribeResourceExhaustedErrorMessage,24 ScribeSessionTimeLimitExceededErrorMessage,25 ScribeTranscriberErrorMessage,26 ScribeUnacceptedTermsErrorMessage,27} from "@elevenlabs/client"2829// ============= Types =============3031export type ScribeStatus =32 | "disconnected"33 | "connecting"34 | "connected"35 | "transcribing"36 | "error"3738export interface TranscriptSegment {39 id: string40 text: string41 timestamp: number42 isFinal: boolean43}4445export interface ScribeCallbacks {46 onSessionStarted?: () => void47 onPartialTranscript?: (data: { text: string }) => void48 onCommittedTranscript?: (data: { text: string }) => void49 onCommittedTranscriptWithTimestamps?: (data: {50 text: string51 timestamps?: { start: number; end: number }[]52 }) => void53 /** Called for any error (also called when specific error callbacks fire) */54 onError?: (error: Error | Event) => void55 onAuthError?: (data: { error: string }) => void56 onQuotaExceededError?: (data: { error: string }) => void57 onCommitThrottledError?: (data: { error: string }) => void58 onTranscriberError?: (data: { error: string }) => void59 onUnacceptedTermsError?: (data: { error: string }) => void60 onRateLimitedError?: (data: { error: string }) => void61 onInputError?: (data: { error: string }) => void62 onQueueOverflowError?: (data: { error: string }) => void63 onResourceExhaustedError?: (data: { error: string }) => void64 onSessionTimeLimitExceededError?: (data: { error: string }) => void65 onChunkSizeExceededError?: (data: { error: string }) => void66 onInsufficientAudioActivityError?: (data: { error: string }) => void6768 onConnect?: () => void69 onDisconnect?: () => void70}7172export interface ScribeHookOptions extends ScribeCallbacks {73 // Connection options74 token?: string75 modelId?: string76 baseUri?: string7778 // VAD options79 commitStrategy?: CommitStrategy80// … truncated
What it pulls in
npm packages
Files it writes
More from shadcn/ui
All 50 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| use-mobileuse-mobile | shadcn/ui | Hooks | Free | no deps | |
| use-transcript-vieweruse-transcript-viewer | shadcn/ui | Hooks | Free | no deps |
