code: async function listCryptoKeyVersions(
    projectId = 'your-project-id', // Your GCP projectId
    keyRingId = 'my-key-ring', // name of the crypto key's key ring
    cryptoKeyId = 'my-key-ring' // name of the crypto key from which to list versions
  ) {
    // Import the library and create a client
    const kms = require('@google-cloud/kms');
    const client = new kms.KeyManagementServiceClient();
  
    // The location of the crypto key's key ring, e.g. "global"
    const locationId = 'global';
  
    // Get full path to crypto key
    const parent = client.cryptoKeyPath(
      projectId,
      locationId,
      keyRingId,
      cryptoKeyId
    );
  
    // Creates a new key ring
    const [versions] = await client.listCryptoKeyVersions({parent});
    if (versions.length) {
      versions.forEach(version => {
        console.log(`${version.name}:`);
        console.log(`  Created: ${new Date(version.createTime.seconds * 1000)}`);
        console.log(`  State: ${version.state}`);
      });
    } else {
      console.log('No crypto key versions found.');
    }
  }
docs: [START kms_list_cryptokey_versions]