How it works
- The SDK loads from
proxy.beyondwords.ioand creates aBeyondWords.Playerinstance. - You pass a project ID and one or more content identifiers (
contentId,sourceId,sourceUrl, orplaylistId). - The widget fetches content and settings from the Widget API, then renders the UI at your
targetelement. - Appearance and behavior come from the Widget page in your project dashboard, unless overridden via widget properties.
Before you begin
- A BeyondWords project with generated content.
- Your numeric project ID (from Settings → Developers).
- A content identifier:
contentId,sourceId,sourceUrl, orplaylistId. See load content below.
Install with an embed script
1
Add a target element
Place a
<div> (or other element) where you want the widget to appear, or use target: this in the script tag to insert the widget immediately after the tag.2
Paste the embed script
Add the script to your page HTML:Replace
YOUR_PROJECT_ID with your numeric project ID and 'YOUR_CONTENT_ID' with the content UUID.The async and defer attributes let the rest of the page load while the SDK downloads. Setting target: this mounts the widget right after the script tag.3
Configure the widget
Customize appearance on the Widget page, or pass widget properties in the
onload handler to override dashboard defaults.Install with NPM
1
Install the package
2
Add a container element
3
Initialize the widget
YOUR_PROJECT_ID and 'YOUR_CONTENT_ID' with your project ID and content UUID.Load content
The widget needsprojectId plus at least one identifier. If you pass multiple identifiers, the widget loads all matching published content as a playlist.
Configuration
Dashboard settings
Configure the widget on the Widget page in your project dashboard:- Widget settings: General, audio, agent, appearance, and tracking settings. Your agent needs the Default version.
- Access tiers: Different experiences by audience.
Property overrides
Pass properties in your embed code or NPM initialization to override dashboard settings. Values set at initialization take precedence over the API defaults. See programmatic control for override order.playerStyle to a legacy version (standard, small, or large) hides your agent.
Programmatic control
Thenew BeyondWords.Player(...) call returns a widget instance you can control at runtime: play, pause, seek, change track, update properties, and listen to events. See programmatic control and the Widget API.
On single-page apps, call player.destroy() or BeyondWords.Player.destroyAll() when removing the widget to free browser resources. To keep one widget across routes instead, see page navigation.
FAQs
Should I use the embed script or NPM?
Should I use the embed script or NPM?
Use the embed script for static sites, CMS templates, or quick prototypes. Use NPM when you’re building with React, Vue, Next.js, or another framework where you import modules and manage component lifecycles.
Why isn't the widget loading?
Why isn't the widget loading?
- Confirm the content has finished generating and is published in the project dashboard.
- Check
projectIdand your content identifier are correct. - Ensure the
targetelement exists before initialization (NPM). - Open the browser console for JavaScript errors.
- If using
sourceUrl, verify the page URL matches the content’ssource_url
Can I load multiple items in one widget?
Can I load multiple items in one widget?
Yes. Pass multiple identifiers, a
playlistId, or a playlist array. The widget loads all matching published content and plays them in sequence. See playlists for curated collections.How do I build a custom player UI?
How do I build a custom player UI?
Set
showUserInterface: false to run in headless mode and build your own controls on top of the SDK. See build your own UI.GitHub repository
JavaScript SDK repository
View the source code, releases, and API documentation on GitHub.