0.1.17 • Published 9 months ago

@humeai/voice-embed v0.1.17

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

Overview

This package enables you to integrate a widget that runs Hume's Empathic Voice Interface any Javascript application. It abstracts away the complexities of managing websocket connections, capturing user audio via the client's microphone, and handling the playback of the interface's audio responses. The widget is embedded into your web page through an iframe.

There are two packages needed to embed your own widget. Install this package to embed the widget to your application. Code for the widget itself can be found at https://github.com/HumeAI/empathic-voice-embed-renderer.

Prerequisites

Before installing this package, please ensure your development environment meets the following requirement:

  • Node.js (v18.0.0 or higher).

To verify your Node.js version, run this command in your terminal:

node --version

If your Node.js version is below 18.0.0, update it to meet the requirement. For updating Node.js, visit Node.js' official site or use a version management tool like nvm for a more seamless upgrade process.

Installation

Add @humeai/voice-embed to your project by running this command in your project directory:

npm install @humeai/voice-embed

This will download and include the package in your project, making it ready for import and use within your React components.

import { EmbeddedVoice } from '@humeai/voice-embed';

NOTE: If you are building a React application, you can use our React voice embed SDK instead of this one. Documentation can be found here.

Usage

Quickstart

Here's a simple example to get you started with the EmbeddedVoice component:

import {
  type CloseHandler,
  EmbeddedVoice as EA,
  type EmbeddedVoiceConfig,
  type TranscriptMessageHandler,
} from '@humeai/voice-embed';

const embeddedVoice = EA.create({
  // Configuration options
});

Note: For integration within server components, instantiate EmbeddedVoice within a client component. For more information checkout the Next.js documentation on client components.

Configuration options

Configuration options for the embedded voice include all props that are accepted by the VoiceProvider in the @humeai/voice-react package.

In addition, it accepts a few other configurations specific to creating a widget:

OptionRequiredDescription
isEmbedOpenyesDetermines the initial visibility of the widget. Assign true to render the widget as open on initial load, and false to start with the widget closed. While the widget's UI provides a trigger to toggle its visibility, this prop also enables external control over the widget's visibility state through a parent component.
rendererUrlnoURL where the widget itself is hosted. If blank, this defaults the Hume AI widget, https://voice-widget.hume.ai. An example of this widget can be found at http://hume.ai.
onMessagenoCallback function to invoke upon receiving a message through the web socket.
onClosenoCallback function to invoke upon the web socket connection being closed.
openOnMountnoBoolean which indicates whether the widget should be initialized in an open or closed state. Set as true if you want it to be open. The default value is false.

Support

If you have questions or require assistance pertaining to this package, reach out to us on Discord!

0.1.17

9 months ago

0.1.16-beta.2

10 months ago

0.1.16-beta.1

10 months ago

0.1.16

9 months ago

0.1.10

1 year ago

0.1.11

11 months ago

0.1.6-beta.1

1 year ago

0.1.12

11 months ago

0.1.13

10 months ago

0.1.14

10 months ago

0.1.15

10 months ago

0.1.11-beta.6

11 months ago

0.1.11-beta.4

12 months ago

0.1.11-beta.5

12 months ago

0.1.15-beta.2

10 months ago

0.1.11-beta.2

12 months ago

0.1.15-beta.3

10 months ago

0.1.11-beta.3

12 months ago

0.1.15-beta.1

10 months ago

0.1.11-beta.1

12 months ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.9

1 year ago

0.1.6

1 year ago

0.1.12-beta.6

11 months ago

0.1.12-beta.5

11 months ago

0.1.12-beta.2

11 months ago

0.1.12-beta.1

11 months ago

0.1.12-beta.4

11 months ago

0.1.12-beta.3

11 months ago

0.1.5

1 year ago

0.1.5-beta.2

1 year ago

0.1.5-beta.1

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.3-beta.2

1 year ago

0.1.3-beta.1

1 year ago

0.1.2-beta.3

1 year ago

0.1.3-beta.3

1 year ago

0.1.2-beta.2

1 year ago

0.1.2-beta.1

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.0-beta.23

1 year ago

0.0.0-beta.22

1 year ago

0.0.0-beta.21

1 year ago

0.0.0-beta.20

1 year ago

0.0.0-beta.19

1 year ago

0.0.0-beta.18

1 year ago

0.0.0-beta.17

1 year ago

0.0.0-beta.16

1 year ago

0.0.0-beta.15

1 year ago

0.0.0-beta.14

1 year ago

0.0.0-beta.13

1 year ago

0.0.0-beta.12

1 year ago

0.0.0-beta.2

1 year ago

0.0.0-beta.1

1 year ago