Skip to main content
Question

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

  • May 25, 2024
  • 6 replies
  • 287 views

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
Figma Learn - Help Center

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


  • Author
  • May 26, 2024

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

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.


  • Author
  • June 2, 2024

Got you thanks!


  • Author
  • June 9, 2024

@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
  • June 10, 2024

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