Skip to content

@elevenlabs/react@1.12.2

Choose a tag to compare

@packages-release-automation packages-release-automation released this 17 Aug 18:09
· 7 commits to main since this release
46cf492

Patch Changes

  • 880edd2: Expose missing realtime speech-to-text options on Scribe.connect(), matching elevenlabs-js#436:

    • secondaryLanguages: additional language codes that may be present in the audio, sent as repeated secondary_languages query params.
    • entityDetection: detect entities (PII, PHI, PCI, offensive language, or specific types) on committed transcripts. Accepts a single value or a list.
    • filterBackgroundAudio: enable background speech filtering to reduce false activations from nearby conversations and ambient noise.

    New server messages are now dispatched instead of being dropped:

    • final_transcript and final_transcript_with_timestamps (RealtimeEvents.FINAL_TRANSCRIPT / FINAL_TRANSCRIPT_WITH_TIMESTAMPS)
    • committed_transcript_entities, carrying DetectedEntity[] (RealtimeEvents.COMMITTED_TRANSCRIPT_ENTITIES)
    • invalid_request, sent when the server rejects the connection parameters (RealtimeEvents.INVALID_REQUEST), emitted alongside the generic ERROR event

    Also fixes vadSilenceThresholdSecs, minSpeechDurationMs, and minSilenceDurationMs lower-bound validation to treat the bound as inclusive, matching the API (e.g. vadSilenceThresholdSecs: 0.3 is now accepted instead of being rejected client-side).

    The scribe.asyncapi.yaml schema (and the generated Word/CommittedTranscriptWithTimestampsMessage/FinalTranscriptWithTimestampsMessage types) was cross-checked against the live contract at https://api.elevenlabs.io/speech-to-text-asyncapi.yml. The words[] shape is identical between committed_transcript_with_timestamps and final_transcript_with_timestamps on that contract (both support "audio_event", per-character timings, and channel_index), so both messages now share a single Word type instead of the narrower shape committed_transcript_with_timestamps previously used. Config also gained timestamps_granularity and max_tokens_to_recompute to match the session config the server echoes back.

    @elevenlabs/react's useScribe().committedTranscripts[].words (WordTimestamp) is updated to match: type now includes "audio_event", characters is now WordTimestampCharacter[] (each with its own start/end) instead of string[], and a channel_index field was added.

  • a068144: Fix a microphone-setup failure wedging useScribe, so a denied or dismissed
    permission prompt can be retried without remounting.

    A microphone-mode session whose getUserMedia call rejects can never send
    audio, but the socket was left open holding that session. useScribe kept its
    connection ref, and every later connect() short-circuited on "Already connected". The failed setup now closes the connection, which releases the
    stranded socket and lets the hook's existing close handling clear the ref.
    onError still fires first; the session then ends as disconnected with the
    error preserved.

    The hook's close handler also nulled its ref for whichever connection reported
    a close, so a late close from a replaced socket tore down the session that had
    replaced it — the race a consumer hit when working around the above with
    disconnect-then-reconnect. A close is now ignored when a newer connection owns
    the ref, while an explicit disconnect() still reports normally.

  • Updated dependencies [880edd2]

  • Updated dependencies [a068144]

    • @elevenlabs/client@1.19.0