@zemd/figma-rest-api
v3.0.18
Published
A lightweight fetch-based and type-safe Figma Rest API client.
Maintainers
Readme
Figma REST API client
A lightweight (4kB only not compressed) fetch-based and type-safe Figma Rest API client.
The package also re-distributes Figma OpenAPI declaration file in JSON format, since original @figma/rest-api-spec provides it only in YAML, which requires adding additional dependency.
The client is built using @zemd/http-client library, which is very simple fetch configurator.
Installation
npm install @zemd/figma-rest-api
pnpm add @zemd/figma-rest-apiUsage
import { figma, figmaToken, header } from "@zemd/figma-rest-api";
const client = figma([figmaToken("your-figma-token")]);
// alternatively you can use figma([header("Authorization", "Bearer <TOKEN>")]);
const response = await client.v1.files.getFile("filekey");
console.log(response);License
@zemd/figma-rest-api released under the Apache 2.0 license
