Integrating Figma with Next.js: REST API vs. Figma Plugin for Component Access

Hi guys! I’m developing a site where users can access my components with Node.js (using Next.js as the backend for REST calls). My question is: for people to be able to access my components through the website and be prompted to open Figma Desktop to see my components, do I need to use the REST API (GET call), or can I use the Figma plugin you download directly through the desktop and somehow incorporate it into my project?

For this you don’t need to use any API, you just need to share a Figma file link.

Opening a Figma file link would allow logged in users to view all the contents of the file.

But I don’t really want to share the file. I want the user to get a “copy” of the component I’ve created so they can design it to fit their needs

In this case you can use the REST API to get the keys from your file to the server and then access them through a plugin, then import the components you need and create instances.

Got you thanks!

@Gleb Hi again! Do you know if it is possible to use the REST API to fetch a component key and load it into Figma Desktop in a similar way as we do with the API by using “Figma.currentPage.selection[0].key”? Or do I need to combine both methods?

With REST API you can only read information, no editing.