
Security News
New CNA Scorecard Tool Ranks CVE Data Quality Across the Ecosystem
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
@figma/rest-api-spec
Advanced tools
This repository contains the OpenAPI specification and Typescript types for the Figma REST API.
Note: this specification is currently in beta. If you notice any inaccuracies with the specification, please file an issue in this repository.
The OpenAPI (v3.1.0) specification is located in the openapi/
directory. This specification can be used with a wide variety of tools to generate API documentation, client SDKs, and more.
The Typescript types are generated from the OpenAPI specification and are located in dist/
.
We use a custom code generator to convert the OpenAPI spec to TypeScript. While there are a number of existing OpenAPI-to-Typescript code generators, we adopted a custom solution that produces output that we believe is more optimal for the Figma REST API. In particular:
Paint
, VariableAlias
, etc...).getFile
-> GetFilePathParams
, GetFileQueryParams
, GetFileResponse
). For API endpoints expecting a request body, the types are suffixed with RequestBody
(e.g. postComments
-> PostCommentsRequestBody
).To use these types in your Typescript code, install the package:
npm install --save-dev @figma/rest-api-spec
Then import the types that you need:
import { type GetFileResponse } from '@figma/rest-api-spec'
// Many popular HTTP clients let you annotate response types
const result = await axios.get<GetFileResponse>(url);
result.data // This has type GetFileResponse
FAQs
Typings for the Figma REST API
The npm package @figma/rest-api-spec receives a total of 54,083 weekly downloads. As such, @figma/rest-api-spec popularity was classified as popular.
We found that @figma/rest-api-spec demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 53 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.