Convert Figma Prototype files to Xstate compatible Finite State Machine objects. It uses the Figma REST api to retrieve a file and transforms it into a Finite State Machine that can be visualized here
๐ Try it out with an UI here: Figma FSM UI
The best way is to use npm
npm install figma-fsm
const figmaFSM = require("figma-fsm")
figmaFSM(<FigmaToken>, <FigmaFileKey>)
.then(result => // Do something with your result).
import figmaFSM from "figma-fsm";
figmaFSM(<FigmaToken>, <FigmaFileKey>)
.then(result => // Do something with your result).
The best way is to create one following the instructions in the Figma API Docs.
- Build a CLI tool.