# Open other external widget once human transfer is initiated

Listen for ticket:agent\_handoff\_initiated and then close the current conversation, hide gleen widget and open your widget.

To close the conversation call. - **window.gleenWidget.closeTicket()**;

To hide Gleen widget call. - **window.gleenWidget.close()**;

Sample code is here

```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>ev Widget</title>
</head>
<body>

<script>
document.gleenConfig = {
    company: "gleen",
    apiBaseUrl: "https://app.alhena.ai"
};
</script>
<script src="https://app.alhena.ai/sdk/gleenWidget.js"></script>

<script>
window.gleenWidget.on("ticket:agent_handoff_initiated", function (data) {
    // Minimize the Gleen widget instead of fully closing it
    window.gleenWidget.closeTicket();
    window.gleenWidget.close();

    // Set up Freshworks widget settings
    ADD code YOUR WIDGET LOAD
});
</script>

</body>
</html>
```
