Ionic capacitor device api

Hi, I have the following code below in an old build of my app and I am trying to port this over to a new build using just capacitor because Im really interested to know how it works.

So the code below gives me the device id. It is really simple and easy to understand and works.

export class HomePage {

  deviceID: any;

  constructor(public device: Device) {
    platform.ready().then(() => {
      this.deviceID = this.device.uuid;      
      }
    }
}

However, I don’t understand what I am supposed to do with the new capacitor API. The example given told me to use the code below but it does not seem to work. I get

’await’ expression is only allowed within an async function.

Also, is the is the platform.ready stuff still needed?

 import { Plugins } from '@capacitor/core';
 
 const { Device } = Plugins;
 
 const info = await Device.getInfo();

 console.log(info);

Thanks.