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 programmatically — useful for a custom launcher button:

// Script tag
window.Beacon.open();
 
// React hook
const beacon = useBeacon({ workspaceId: 'YOUR_WORKSPACE_ID' });
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 shouldn't 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>

Example: custom launcher

export default function SupportButton() {
  const beacon = useBeacon({ workspaceId: 'YOUR_WORKSPACE_ID' });
 
  return (
    <button onClick={() => beacon.open()}>
      Talk to support
    </button>
  );
}

On this page