Skip to main content
May 25, 2024 8:30 AM UTC
Question

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?

This topic has been closed for replies.

6 replies

Gleb
Power Member
May 25, 2024 9:13 AM UTC
Figma Learn - Help Center

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

kellzAuthor
May 26, 2024 6:12 PM UTC

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

Gleb
Power Member
May 26, 2024 7:03 PM UTC

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.

kellzAuthor
Jun 2, 2024 1:32 PM UTC

Got you thanks!

kellzAuthor
Jun 9, 2024 7:18 PM UTC

@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?

Gleb
Power Member
Jun 10, 2024 4:17 AM UTC

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