Detecting Headset on Start

Wanted to find out how the webXREnterExitUI decides whether to be displayed or not. I am trying to replicate this functionality with a custom button of mine.

How can I check to see if there is a headset connected and ready to be used?

adding @RaananW our XR guru to the thread

looks like here:
Babylon.js/webXREnterExitUI.ts at 4ccc01e98a5f05bdcbab76699a69a93eed26461b · BabylonJS/Babylon.js (

But you can check yourself if a session is supported:
Babylon.js/webXRSessionManager.ts at 7dca66b3127dfb5e0614f4e539a2e8a655d3e7b5 · BabylonJS/Babylon.js (

edit: oh – and welcome to the forum! :smile:


There is no way to detect if a headset is connected, nor what kind it is. There is a way to check if a session type is supported in your system. The os might support a session even without a headset.
Brian linked the right methods.