Skip to content

Craft ​

Craft is a powerful, beautiful tool for creating documents, managing tasks, and organizing your work and life. Protocol Launcher allows you to generate deep links to open and create content in Craft.

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 App ​

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

const url = open()

Open Document ​

On-Demand
ts
import { openDocument } from 'protocol-launcher/craft'

const url = openDocument({
  spaceId: 'abc-123',
  blockId: 'xyz-789',
})

Create Document ​

On-Demand
ts
import { createDocument } from 'protocol-launcher/craft'

const url = createDocument({
  spaceId: 'abc-123',
  title: 'My Note',
  content: 'Hello **World**',
  folderId: '',
})

Create New Document ​

On-Demand
ts
import { createNewDocument } from 'protocol-launcher/craft'

const url = createNewDocument()

Create Block ​

On-Demand
ts
import { createBlock } from 'protocol-launcher/craft'

const url = createBlock({
  parentBlockId: 'doc-123',
  spaceId: 'abc-123',
  content: 'New content',
  index: 9999,
})

Open Daily Note ​

On-Demand
ts
import { openDailyNote } from 'protocol-launcher/craft'

const url = openDailyNote({
  spaceId: 'abc-123',
  type: 'today',
})
On-Demand
ts
import { openSearch } from 'protocol-launcher/craft'

const url = openSearch({
  spaceId: 'abc-123',
  query: 'vacation plans',
})

Open Space ​

On-Demand
ts
import { openSpace } from 'protocol-launcher/craft'

const url = openSpace({
  spaceId: 'abc-123',
  tab: 'calendar',
})