This module provides endpoints for the Figma web API.
Create a token to be used with the Personal Access Token authentication method. Read more.
Create a token to be used with the OAuth 2 authentication method. Read more.
A file key which univocally identifies Figma document on the server.
Note: The file key can be extracted from any Figma file URL: https://www.figma.com/file/:key/:title, or via the [getFiles][#getFiles] function.
The file data returned by the server. In particular:
document is the root node of the document.components is a mapping from node ID's to component metadata. This helps you determine
which components each instance comes from.Construct a web request to return the latest version of the file referred by key and store it into a File record.
import Http
import Figma as F
F.getFile ( F.personalToken "your-token" ) "your-file-key"
|> Http.send FileReceivedAlternatively getFile can be chained together with another request (or any other task) resulting in a single command.
F.getFile ( F.personalToken "your-token" ) "your-file-key"
|> Http.toTask
|> Task.andThen
(\file ->
let
options =
{ format = Document.JpegFormat
, scale = 1.0
}
nodeIds =
-- Extract your node ID's from file.document here
in
F.exportNodesWithOptions authToken fileKey options nodeIds
|> Http.toTask
)
|> Task.attempt NodesExportedMetadata for a master component. Component data is stored in a Document.Component record.
Unique identifier for file version.
A version of a file.
Construct a web request to list the version history of a file. The version history consists of versions, manually-saved additions to the version history of a file. If the account is not on a paid team, version history is limited to the past 30 days.
Note that version history will not include autosaved versions.
Construct a web request to return specific file version.
A comment is either a "top comment" or a reply to it.
A comment left by a user.
A reply to a comment.
Construct a web request to return a list of comments left on the document.
Construct a web request to add a new comment to the document.
Return the Comment that was successfully posted.
Construct a web request to export a list of document nodes into PNG files at 1x resolution.
If you need to specify a different scale value use exportNodesWithOptions.
Construct a web request to export a list of document nodes into JPEG files at 1x resolution.
If you need to specify a different scale value use exportNodesWithOptions.
Construct a web request to export a list of document nodes into SVG files at 1x resolution.
If you need to specify a different scale value use exportNodesWithOptions.
Construct a web request to export a list of document nodes into the given format files using
the given scale factor automatically clamped within the 0.01–4 range.
A tuple made of the node ID and the image URL of its rendered representation.
A Nothing value indicates that rendering of the specific node has failed. This may be due to
the node id not existing, or other reasons such has the node having no renderable components.
A value which uniquely identifies a team.
A value which uniquely identifies a project.
A single team project.
Construct a web request and return the list of projects of the given team.
Note that this will only return projects visible to the authenticated user or owner of the developer token.
Construct a web request to return the list of files of the given project.
Metadata for a project file.
A description of a user.