How to know when a VR session started?

How can I know when the vr session starts?
like

if(vrsession.start="True"){
    this.headObject.getComponent('wasd-control').headObject = this.chromeAndroidHeadObject; 
}

is there any code like this ?

I usually do this in start

if (WL.xrSession) {
   this._onXRSessionStart(WL.xrSession);
}
WL.onXRSessionStart.push(this._onXRSessionStart.bind(this));
WL.onXRSessionEnd.push(this._onXRSessionEnd.bind(this));

xr session start is called when the session start, the first if is done in case the session was already created

thanks :+1: