We have to requirement to close the webpage where the chat widget is plugged in. Once the chat is completed/Ended by the customer, the webpage should close automatically.
Is there a event/notification sent by the widget which can be captured when the chat session is completed/ended by the customer?
If you are using Genesys Widget v2.0, then, there are several events that you could indeed leverage.
If you want to trigger your code when the customer closes the chat window (i.e. ends the interaction and then close the chat window showing the messages/transcript), you can use WebChat.closed event.
If you want to trigger your code as soon as the chat session is ended, you can use (WebChat.completed and WebChat.cancelled) or WebChatService.ended.