Hi,
I trying to get the component set from our team component library. Currently need one specific component set. I have token and component set key. When a use https://www.figma.com/developers/api#get-component-sets-endpoint everything look good. I get json response. But when I use this codem, I don’t have any response or error. Nothing 😦
My code:
async function postData() {
// Default options are marked with *
const url = “https://api.figma.com/v1/component_sets/ea1fdf3f1f3edb9a47fcacXXXXXXXXXX”
const response = await fetch(url, {
method: “GET”,
headers: {
“Content-Type”: “application/json”,
“X-FIGMA-TOKEN”: “figd_ieTLw28Y9FATHrnPMCmwBtXXXXXXXXXXXXXXXX”
},
});
return response.json(); // parses JSON response into native JavaScript objects
console.log(response.json());
}
postData()
And second question, after I have a response (json) how do I create an instance of this component set?
Thanks a lot
T.