You can integrate Sketch into your app or worflow using the sketch:// URL scheme. You can even open documents in Sketch already focused on specific layers or with a specified zoom level.

Note: If a document is already open the canvas view does not change.

Center layer and specify zoom level

The URL scheme accepts two parameters. If the path to the file is provided without any parameters the file will be opened in the same way it was last saved.


centerOnLayer string

To obtain the layer id use either the JavaScript API or read the document’s JSON data directly.


To get the id of the current selection, select a layer within the current document in Sketch and run the following script from the Run Script… panel in the Plugins menu.

const document = require('sketch/dom').getSelectedDocument()

document.selectedLayers.forEach(layer => console.log(

zoom number

Actual Size has a zoom level of 1. To zoom out specify values between 0...1 while using values greater than 1 to zoom in, e.g. 2 for 200%.

Run a plugin command

Availability: Sketch 55+

Run a plugin command and pass query parameters to the a JavaScript handler.



The command must implement the HandleURL action and have it defined in the plugin manifest in order to be run.

const sketch = require('sketch')

// If you're using skpm: export function handleURL(context)
function handleURL(context) {
  let query = context.actionContext.query
  sketch.UI.message(query.msg || '👋')
  "identifier": "com.example.sketch.messenger",
  "commands": [
      "name": "Message",
      "identifier": "",
      "script": "command.js",
      "handlers": {
        "actions": {
          "HandleURL": "handleURL"

Open the following link to display a Hello World message within an open document. Provide any URL encoded string with the msg query parameter.


See something wrong or incomplete? Improve this page.