Add the ThunderPhone voice widget to any website without a bundler
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.
ThunderPhone.mount() returns a widget instance with cleanup methods:
Copy
<script> const widget = ThunderPhone.mount({ element: '#thunderphone', apiKey: 'pk_live_your_publishable_key', agentId: 123, }) // Later, when you want to remove the widget: widget.unmount() // Or equivalently: widget.destroy()</script>
Both unmount() and destroy() do the same thing — they disconnect any active 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.
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().
ThunderPhone is not defined
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.
Domain not allowed error
Add your domain to the allowed domains list in Developers settings at app.thunderphone.com. Remember that localhost is always allowed.