Skip to main content
The BeyondWords JavaScript widget delivers audio, video, and your agent on any webpage. Install it with an embed script (quickest) or the NPM package (best for frameworks and build tools).
Using Magic Embed, WordPress, or Ghost? The widget may already be installed, so check your integration guide before adding the SDK manually.

How it works

  1. The SDK loads from proxy.beyondwords.io and creates a BeyondWords.Player instance.
  2. You pass a project ID and one or more content identifiers (contentId, sourceId, sourceUrl, or playlistId).
  3. The widget fetches content and settings from the Widget API, then renders the UI at your target element.
  4. 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, or playlistId. 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

The container must exist in the DOM before you initialize the widget.
3

Initialize the widget

Replace YOUR_PROJECT_ID and 'YOUR_CONTENT_ID' with your project ID and content UUID.

Load content

The widget needs projectId 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.
Setting playerStyle to a legacy version (standard, small, or large) hides your agent.

Programmatic control

The new 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

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.
  • Confirm the content has finished generating and is published in the project dashboard.
  • Check projectId and your content identifier are correct.
  • Ensure the target element exists before initialization (NPM).
  • Open the browser console for JavaScript errors.
  • If using sourceUrl, verify the page URL matches the content’s source_url
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.
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.