Speechly Browser UI components
Ready made Speechly UI components to build a reactive voice interface to a web site or app.
If you want to build a custom interface for you web app, you may want to check out browser-client (npm) for direct access to Speechly API.
Documentation
Browser Usage
Include the Web Components from a CDN that mirrors @speechly/browser-ui
npm package. The script tags register push-to-talk-button
, big-transcript
and error-panel
with the browser's customElement registry so you can use them like regular tags.
<head>
<script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/push-to-talk-button.js"></script>
<script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/big-transcript.js"></script>
<script type="text/javascript" src="https://unpkg.com/@speechly/browser-ui/core/error-panel.js"></script>
</head>
<body>
<big-transcript placement="top"></big-transcript>
<push-to-talk-button placement="bottom" appid="YOUR_APP_ID_FROM_SPEECHLY_DASHBOARD"></push-to-talk-button>
<error-panel placement="bottom"></error-panel>
</body>
Push-to-talk button component comes with built-in browser-client so you don't need to include it separately.
Node Usage
This example illustrates using browser-ui Web Components with a JS framework. For actual React development, you'll probably want to use react-client and react-ui libraries for a better developer experience.
npm i @speechly/browser-ui
In App.js:
import "@speechly/browser-ui/core/push-to-talk-button";
import "@speechly/browser-ui/core/big-transcript";
import "@speechly/browser-ui/core/error-panel";
...
<big-transcript placement="top"></big-transcript>
<push-to-talk-button placement="bottom" appid="YOUR_APP_ID_FROM_SPEECHLY_DASHBOARD"></push-to-talk-button>
<error-panel placement="bottom"></error-panel>
Building and developing
The build steps are needed if you want to contibute to the development of the components or need to fork them for customization.
Requirements
- Node (tested with v14.16.1+)
Built With
Install Rush (one-time only)
npm install -g @microsoft/rush
Running the development build
rush update
rush build --to-except browser-ui
# Run the library in watch mode. Open http://localhost:5000 to see the testbench page.
rushx dev
Building for production
rush update
rush build --to browser-ui
# Check build artefacts
ls core/
Learn more