Skip to content

Sketch

Sketch is a vector graphics editor for macOS primarily used for user interface and icon design. Protocol Launcher allows you to generate deep links to open files, add libraries, and run plugins in Sketch.

Usage

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

Open Sketch

On-Demand
ts
import { open } from 'protocol-launcher/sketch'

const url = open()

Open File

On-Demand
ts
import { openFile } from 'protocol-launcher/sketch'

const url = openFile({
  path: '/Users/name/Documents/design.sketch',
})

Open File with Layer Focus and Zoom

On-Demand
ts
import { openFile } from 'protocol-launcher/sketch'

const url = openFile({
  path: '/Users/name/Documents/design.sketch',
  centerOnLayer: 'layer-123',
  zoom: 2,
})

Add Library

On-Demand
ts
import { addLibrary } from 'protocol-launcher/sketch'

const url = addLibrary({
  url: 'https://developer.apple.com/design/downloads/sketch.rss',
})

Run Plugin

On-Demand
ts
import { runPlugin } from 'protocol-launcher/sketch'

const url = runPlugin({
  pluginId: 'com.example.sketch.messenger',
  commandId: 'message.show',
})

Run Plugin with Query Parameters

On-Demand
ts
import { runPlugin } from 'protocol-launcher/sketch'

const url = runPlugin({
  pluginId: 'com.example.sketch.messenger',
  commandId: 'message.show',
  query: { msg: 'Hello World' },
})