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 player fetches content and settings from the player API, then renders the UI at your
targetelement. - Appearance and behavior come from Distribution → Player → Settings in your dashboard, unless overridden via player properties.
Before you begin
- A BeyondWords project with generated content
- Your numeric project ID (from Settings → Integrations → API)
- A content identifier—
contentId,sourceId,sourceUrl, orplaylistId. See load content below.
Install with an embed script
Add a target element
Place a
<div> (or other element) where you want the player to appear, or use target: this in the script tag to insert the player immediately after the tag.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 player right after the script tag.Configure the player
Customize appearance in Distribution → Player → Settings, or pass player properties in the
onload handler to override dashboard defaults.Install with NPM
Load content
The player needsprojectId plus at least one identifier. If you pass multiple identifiers, the player loads all matching published content as a playlist.
| Identifier | Use when |
|---|---|
contentId | You have the BeyondWords content UUID |
sourceId | You have your CMS article ID (recommended—more stable than URLs) |
sourceUrl | You want to match by page URL (defaults to window.location.href if nothing else is set) |
playlistId | Loading a Standard or Smart playlist |
playlist | Building a dynamic playlist from an array of identifiers |
Configuration
Dashboard settings
Configure the player in Distribution → Player in your project dashboard:- Settings—size, colors, highlighting, continuous playback, downloads
- 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.Programmatic control
Thenew BeyondWords.Player(...) call returns a player instance you can control at runtime—play, pause, seek, change track, update properties, and listen to events. See programmatic control and the player API.
On single-page apps, call player.destroy() or BeyondWords.Player.destroyAll() when removing the player to free browser resources.
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 player loading?
Why isn't the player loading?
- Confirm the content has finished generating and is published in the 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 player?
Can I load multiple items in one player?
Yes. Pass multiple identifiers, a
playlistId, or a playlist array. The player 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.