CDN URLs
Basic Usage
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:
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:Troubleshooting
Widget doesn't appear
Widget doesn't appear
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
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
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.Next Steps
Styling
Customize the widget appearance with CSS custom properties.
React Component
Using React? The component integration is simpler.