Code Monkey home page Code Monkey logo

figma-js's Introduction

Figma.js

A simple wrapper for the Figma API.

Cool projects using this:

Usage

Full documentation 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

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…

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!

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

Just reusing types

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

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 repo for this - refer to its README for more detailed instructions.

Helpful development commands:

yarn watch
yarn docs
yarn docs:publish

Contributions welcomed

Committing

yarn global add commitizen

# instead of git commit

git cz

Contributors

figma-js's People

Contributors

chrisdrackett avatar jemgold avatar mathieudutour avatar mikkmartin avatar gorango avatar jamiemill avatar kerumen avatar saveyourtime avatar anselmdk avatar bruno12mota avatar xtiandiaz avatar davidpett avatar dvdsgl avatar dmiller9911 avatar ergofriend avatar erictaylor avatar gaurav-bhardwaj-ind avatar g-a-v-i-n avatar jeetiss avatar jhardy avatar jonrimmer avatar liammartens avatar yonezo avatar piperchester avatar tujoworker avatar drakosvlad avatar dependabot[bot] avatar jacoblapworth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.