Speechly browser client
With the browser-client you can add voice features to any website. It handles authentication, audio capture, network streaming and connection management with the Speechly Voice API.
Check out the browser-client-example repository for a demo app built using this client.
NOTE: If you are using React, you can use our React client instead. It provides the same functionalities, but provides a programming model that is idiomatic to React.
Usage
Install the package:
# Using Yarn
yarn add @speechly/browser-client
# Using NPM
npm install --save @speechly/browser-client
Start using the client:
import { Client, Segment } from '@speechly/browser-client'
const client = new Client({appId: 'your-app-id'})
await client.initialize()
client.onSegmentChange((segment: Segment) => {
console.log('Received new segment from the API:', segment.intent, segment.entities, segment.words, segment.isFinal)
})
await client.startContext()
setTimeout(async function() {
await client.stopContext()
}, 3000)
Documentation
You can find the detailed browser-client API documentation in the GitHub repository.
You can also refer to Speechly Docs for more information.
Contributing
See contribution guide in CONTRIBUTING.md.