How to use getBoundingClientRect() in velo (wix-window)?

Here a simple example, similar to your needs…

$w.onReady(async function () {
     console.log("DisplayResolution: ", await getScreenSize())
});

function getScreenSize() {
   let windowHeight
   let windowWidth
   let DisplayResolution

   return wixWindow.getBoundingRect()
  .then((windowSizeInfo) => {
      windowHeight = windowSizeInfo.window.height;
      windowWidth = windowSizeInfo.window.width;
      DisplayResolution = windowWidth+"x"+windowHeight
 //  let x = windowWidth;
 //  let y = windowHeight
     return (DisplayResolution)
  });
}