Skip to main content
The CDN build bundles React internally, so you can use the widget on static sites, WordPress, Webflow, or any page where you can add HTML. No npm, no bundler, no framework required.

CDN URLs

The latest URLs are what the dashboard’s embed snippet generator produces. They are cached for 5 minutes and pick up new stable releases automatically. Pinned /widget/vX.Y.Z/ paths are immutable and cached long-term — if you pin, match the version to the @thunderphone/widget npm release you develop against.

Basic Usage

The widget mounts into the target element and renders as a fixed-position bar in a corner of the viewport (default bottom-right, controlled by the position option). The mount element is only the React root — its location in the page does not affect where the widget appears.

Mount Options

ThunderPhone.mount() accepts the same options as the React component, plus the element property:

Cleanup

ThunderPhone.mount() returns a widget instance with cleanup methods:
Both unmount() and destroy() do the same thing — they disconnect any active voice session and remove the widget from the DOM. Use whichever reads better in your code.
Always clean up the widget when navigating away in single-page applications or when the containing element is removed. This ensures active voice sessions are properly disconnected.

Examples

Dark Theme with Custom Color

Custom Position

With Event Callbacks

With Ringtone

Using a DOM Element Reference

WordPress / CMS Integration

Add this to a Custom HTML block or your theme’s footer:
The <div> can go anywhere — it is only the mount point. The widget itself renders as a fixed overlay in a viewport corner (set by the position option) and does not flow with surrounding content.

Troubleshooting

Make sure both the CSS and JS files are loaded. Check the browser console for network errors. Verify that the target element exists in the DOM before calling ThunderPhone.mount().
The script has not loaded yet. Ensure the <script> tag for widget.js appears before your mount call, or wrap the mount call in a DOMContentLoaded listener.
Add your domain to the allowed domains list in Developers settings at app.thunderphone.com. Remember that localhost is always allowed.

Next Steps

Styling

Customize the widget appearance with CSS custom properties.

React Component

Using React? The component integration is simpler.