Developing a Plugin for Automating Design Fetch and Recreation from a Single-Component Figma File

Hi, I’m wondering whether it would be possible to create a plugin that fetches a component from a Figma file (based on a link I provide), which has one component, and recreates it when I run my plugin?

Yes, it’s possible.

I do this by getting the key file in URL.
URL =<key>/name?type=design&t=xyz

I use REST API for get components list

curl -H 'X-FIGMA-TOKEN: xxx' '<key>/components'

And then take key component for import using importComponentByKeyAsync

const importComponent = await figma.importComponentByKeyAsync(key);
const instance = importComponent.createInstance();
const page = figma.currentPage;