Get Started
Here are some basic steps for getting started for web:
- Add basic integration
- Add custom configuration and themes
- Listen to Speechify API events
- Run actions on the Speechify API
Basic Integration Example​
To integrate the API, you'll need to:
- Import the package using
import
- Get the parent element for the content you want to make listenable (or your article)
- If you'd like to use the inline player, get the element for the title of the content you want to make listenable. The inline player will be placed under that title.
- Mount the Speechify API!
Vanilla JS​
You need to have the following element in the place where you want to attach the inline player.
<div id="speechify-root"></div>
In plain JS, this looks like:
import(
"{CDNLinkToLibrary}"
).then(async (speechifyWidget) => {
// this parent element for your article or listenable content
const articleRootElement = document.querySelector("article");
const widget = speechifyWidget.makeSpeechifyExperience({
rootElement: articleRootElement,
useSpeechifyRoot: true
});
await widget.mount();
});