# figma-js

> A simple wrapper for the Figma API

Latest version **1.16.1-0** (published 2024-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install figma-js
pnpm add figma-js
yarn add figma-js
bun add figma-js
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.16.1-0 |
| Published | 2024-03-14 |
| First published | 2018-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.9 |
| Dependencies | 1 |
| Unpacked size | 119.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 494 |
| Maintainers | jongold, chrisdrackett, anselmdk |

## Links

- npm: https://www.npmjs.com/package/figma-js
- Repository: https://github.com/jemgold/figma-js
- npm.io page: https://npm.io/package/figma-js

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^1.6.0

## Recent versions

- 1.16.1-0 (latest) — 2024-03-14
- 1.6.0 (true) — 2019-02-08
- 1.16.0 — 2022-08-18
- 1.15.0 — 2022-02-16
- 1.14.0 — 2021-06-21
- 1.13.0 — 2020-09-11
- 1.12.0 — 2020-09-11
- 1.11.0 — 2020-07-14
- 1.10.1 — 2020-05-20
- 1.10.0 — 2020-03-26
- 1.9.0 — 2019-12-03
- 1.8.5 — 2019-10-08
- 1.8.4 — 2019-09-09
- 1.8.3 — 2019-08-19
- 1.8.2 — 2019-08-18
- … 18 more at https://npm.io/package/figma-js/versions

## README

# Figma.js

A simple wrapper for the Figma API.

Cool projects using this:
- [figma-graphql](https://github.com/braposo/figma-graphql)
- [figmint](https://github.com/tiltshift/figmint)

## Usage

[Full documentation](https://jemgold.github.io/figma-js) is available on the web and most everything is typed with TypeScript.

### Creating a client

Quickest start is to grab a personal access token from your Figma account settings page

```typescript
import * as Figma from 'figma-js';

const token = '12345';

const client = Figma.Client({
  personalAccessToken: token
});
```

Or if you're building an app with OAuth authentication, after you get back the OAuth access token…

```typescript
import * as Figma from 'figma-js';

const token = '12345';

const client = Figma.Client({
  accessToken: token
});
```

### Doing cool things

Once you have instantiated a client, have fun!

```typescript
client.file('file-id').then(({ data }) => {
  console.log(data);
});
```

### Just reusing types

All of the types in the Figma file format / API are exported.

```typescript
import * as Figma from 'figma-js';

const textNode: Figma.Text = {
  // … this should autocomplete if your editor is set up for it!
};
```

## Contributing

We used the [`typescript-starter`](https://github.com/bitjson/typescript-starter) repo for this - refer to its README for more detailed instructions.

Helpful development commands:

```sh
yarn watch
yarn docs
yarn docs:publish
```

### Contributions welcomed

* [ ] [generate types automatically](https://github.com/jemgold/figma-js/issues/1)
* [ ] [add tests](https://github.com/jemgold/figma-js/issues/2)

### Committing

```sh
yarn global add commitizen

# instead of git commit

git cz
```

## Contributors

* [@jemgold](https://github.com/jemgold/) (Airbnb)
* [@chrisdrackett](https://github.com/chrisdrackett/)

---
_Source: https://npm.io/package/figma-js · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
