Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chuanqisun/figma-development-kit

A set of tools that augment the Figma API
https://github.com/chuanqisun/figma-development-kit

figma figma-api oauth2 sdk

Last synced: 26 days ago
JSON representation

A set of tools that augment the Figma API

Awesome Lists containing this project

README

        

## OAuth2
[demo](https://chuanqisun.github.io/figma-development-kit/demo/auth-demo.html) | [src](https://github.com/chuanqisun/figma-development-kit/blob/master/demo/auth-demo.html)

### Quick start
Download [`callback.html`](https://raw.githubusercontent.com/chuanqisun/figma-development-kit/master/dist/callback.html) and add it to your project. Make sure you add the url of the callback file to your [Figma developer settings page](https://www.figma.com/developers/apps). Learn more by reading the [Figma OAuth2 setup guide](https://www.figma.com/developers/docs#auth-oauth).

Directly use in browser
```html

```
```js
const figmaApi = new fdk.FigmaApi({
clientId: '',
clientSecrete: '',
/* e.g. http://localhost:5000/callback.html or https://www.my-awesome-project.com/callback.html */
redirectUri: '',
});

figmaApi.getOAuth2Token().then(token => {
console.log(token);
});
```

Import as an ES6 module
```shell
npm install --save figma-development-kit
```

```js
import { FigmaApi } from 'figma-development-kit';

const figmaApi = new FigmaApi({
clientId: '',
clientSecrete: '',
redirectUri: '',
});

figmaApi.getOAuth2Token().then(token => {
console.log(token);
});
```