setFileThumbnailNodeAsync not working?

I’m having trouble getting figma.setFileThumbnailNodeAsync to work properly.

When I run

var coverFrame = figma.createFrame() figma.setFileThumbnailNodeAsync(coverFrame) console.log(figma.getFileThumbnailNode()

The console returns null

My understanding is that I’ve created a frame node, then set that frame node as the file thumbnail, so the console should return that frame node?

Am I missing something? Thanks in advance for any help.

You need to wait for the async function to complete before you can get the thumbnail node.