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
ts
import { open } from 'protocol-launcher/craft'
const url = open()Open Document
ts
import { openDocument } from 'protocol-launcher/craft'
const url = openDocument({
spaceId: 'abc-123',
blockId: 'xyz-789',
})Create Document
ts
import { createDocument } from 'protocol-launcher/craft'
const url = createDocument({
spaceId: 'abc-123',
title: 'My Note',
content: 'Hello **World**',
folderId: '',
})Create New Document
ts
import { createNewDocument } from 'protocol-launcher/craft'
const url = createNewDocument()Create Block
ts
import { createBlock } from 'protocol-launcher/craft'
const url = createBlock({
parentBlockId: 'doc-123',
spaceId: 'abc-123',
content: 'New content',
index: 9999,
})Open Daily Note
ts
import { openDailyNote } from 'protocol-launcher/craft'
const url = openDailyNote({
spaceId: 'abc-123',
type: 'today',
})Open Search
ts
import { openSearch } from 'protocol-launcher/craft'
const url = openSearch({
spaceId: 'abc-123',
query: 'vacation plans',
})Open Space
ts
import { openSpace } from 'protocol-launcher/craft'
const url = openSpace({
spaceId: 'abc-123',
tab: 'calendar',
})