Object that resizes based on the viewport size

Hi, I’m kinda struggling with the responsiveness within three.js. I’m trying to show a 3d model using the gltf loader, but I’d like the model to resize based on the users viewport size. Take https://modelviewer.dev/, a simple took using three.js, but the astronaut shown resizes based on the viewport size. Is this also possible within three.js? I just want the object to stay within view and not get cut off by the edges of the viewport.
Does anybody know how to do this?