Skip to content

Instantly share code, notes, and snippets.

@danhollick
Last active October 9, 2018 10:01
Show Gist options
  • Select an option

  • Save danhollick/d2019caaaee67165075c5976db6137e2 to your computer and use it in GitHub Desktop.

Select an option

Save danhollick/d2019caaaee67165075c5976db6137e2 to your computer and use it in GitHub Desktop.
Async server request
var express = require('express')
var fetch = require('isomorphic-fetch')
const FigmaAPIKey = 'mysecretkey'
const FigmaFileID = 'VAyAHaZn1tHmjOFK79pbnMTj'
async function figmaFileFetch(fileId){
let result = await fetch('https://api.figma.com/v1/files/' + fileId , {
method: 'GET',
headers: {
'X-Figma-Token': FigmaAPIKey
}
})
let figmaFileStruct = await result.json()
return figmaFileStruct
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment