Control the Widget
Open, close, and shut down Beacon programmatically.
All Beacon methods are available on window.Beacon (script tag) or via the useBeacon hook return value (React).
Open
Open the widget panel:
window.Beacon.open();
// or: beacon.open()
Close
Close the widget panel:
window.Beacon.close();
// or: beacon.close()
Shutdown
Remove the widget from the page entirely. Use this on logout or when navigating to a page where the widget should not appear:
window.Beacon.shutdown();
// or: beacon.shutdown()
After shutdown(), call Beacon.boot() again to re-initialise.
Boot manually
For SPAs or deferred loading, skip data-workspace-id and boot manually:
<script src="https://cdn.renprofile.me/widget/loader.js"></script>
<script>
Beacon.boot({ workspace_id: 'YOUR_WORKSPACE_ID' });
</script>
Hide the floating launcher
If you want to place your own button instead of using the default floating launcher, pass hide_default_launcher: true:
Beacon.boot({
workspace_id: 'YOUR_WORKSPACE_ID',
hide_default_launcher: true
});
See Hide the Default Launcher for the full guide including data-hide-launcher, toggleLauncher, and custom badge patterns.
Open with specific content
Beyond a plain open(), Beacon lets you open to a specific state:
// Open with the composer pre-filled
Beacon.showNewMessage('I have a question about pricing');
// Open and immediately send a message
Beacon.startConversation('I hit an error during checkout');
// Open to the Help Articles tab
Beacon.showSpace('articles');
See Open Methods for the full reference.
Example: custom launcher button
export default function SupportButton() {
const beacon = useBeacon({ workspaceId: 'YOUR_WORKSPACE_ID' });
return (
<button onClick={() => beacon.open()}>
Talk to support
</button>
);
}