Start extending Sketch…
Plugins
Add to and customize the functionality of Sketch using JavaScript or Objective-C. Modify the document using Sketch’s APIs, add your own user interface or integrate Sketch with your product or other applications.
CLI
Use the sketchtool
command-line interface to export assets, inspect documents and run plugins.
Sketch file format
Generate, modify and process Sketch files directly with the open JSON file format.
Sketch.app
Integrate Sketch into your workflows with the sketch://
URL scheme.
Getting started
Run a script
Try the Sketch JavaScript API now, directly within Sketch. The code below shows a message at the bottom of your Sketch Document window saying Hello Sketch 👋.
- Open a new or existing file in Sketch
- Select Run Script… from the Plugins menu or use the keyboard shortcut
control + shift + k
to bring up the code editor - Paste in the code below
- Select Run
const sketch = require('sketch')
sketch.UI.message('Hello Sketch 👋')
Publish a plugin
Use the Sketch Plugin Manager skpm
to publish a new plugin or an update of an existing one. This adds your plugin automatically to the Sketch Plugin Directory for review before being listed on the Sketch website.
Export assets automatically
Create assets with a single command with the Sketch command-line interface sketchtool
. Quickly generate files for all exportable layers, slices, artboards or entire pages in as many different resolutions as you want.
- Open a new file in Sketch
- Add a shape or anything else to the canvas
- Save the file locally, e.g. App.sketch on your Desktop
- Open Terminal and run the following command, which looks up the
sketchtool
bundled with Sketch and exports all pages of App.sketch.
This will generate an image file called Page 1.png in the same folder you ran the command in.
SKETCH=$(mdfind kMDItemCFBundleIdentifier == 'com.bohemiancoding.sketch3' | head -n 1) && \
"$SKETCH/Contents/Resources/sketchtool/bin/sketchtool" export pages ~/Desktop/App.sketch
Not a developer? Submit an idea
Although you’ll need some programming experience to extend Sketch yourself, you can also submit an idea to let us and the community know how you’d like to see Sketch extended.
Take a look at the list of plugins the community has already built.
We’re here to help
Developer Forum
Join our developer forum to discuss your questions and code.
Examples
Explore some sample plugins built by Sketch.
Support
Get in touch with us.
API Reference
View the Plugin JavaScript API reference.