How access other file by Figma API

As you were told above, you are using await outside of an async function. Just create an async function and call it:

async function importNode() {
    let importComponent = await figma.importComponentByKeyAsync(key);
    importComponent.createInstance()
}

importNode()
2 Likes