Prerequisites
git— to clone the sample repo.deno— the sample builds, tests, and runs entirely viadeno task(no Node needed). Often not pre-installed; checkdeno --versionand point the user to https://deno.com if missing.- Gety desktop app installed with CLI integration enabled — not required to build or test the connector, only to install it and verify with
gety search/gety doc.
Check these early; if git or deno is missing, ask the user to install before coding.
Workflow
- Inspect the connector repo before editing.
- New connectors must start from
https://github.com/gety-ai/gety-sample-connector; do not hand-create a connector skeleton. - If there is no sample-derived repo, clone the sample repo into the user's requested folder, then adapt it.
- If the current repo is not a clone/fork of
gety-sample-connector, ask the user to switch to or clone a sample-based repo before coding. - Read
references/gety-custom-connector-contract.mdbefore changing manifest shape, SDK lifecycle,doc_link, metadata, state, file/download behavior, or validation commands.
- New connectors must start from
-
Clarify source semantics before coding.
- Confirm auth method, required config fields, document identity, title/content mapping, source updated/created timestamps, deletion handling, and link behavior.
- Explain the proposed content extraction plan and ask the user which source fields/content should become Gety
title,content, metadata, and links before implementing. - Stop and discuss if the source needs OAuth browser login, ephemeral signed URLs, lazy remote file preview/download, binary extraction, or mixed URL/file links. The current skill scope does not cover those capabilities end to end.
-
Design the Gety document contract.
- Choose stable
idvalues and a connector-owneddoc_typesuch aslinear:issueorgithub:issue. - Set
content_format: "markdown"only whencontentis genuinely markdown (e.g. an issue body); keep plain text — titles, URLs, line-separated fields — as"plaintext"(the default). Do not misusedoc_typeto control markdown preview. - Put stable browser URLs in
metadata.urland use manifestdoc_link: { "kind": "url", "field": "url" }. - Use
doc_updated_atfor the source document update time andmetadata.created_atfor source creation time when available.
- Choose stable
-
Implement
src/index.ts.- Extend
Connector<ManifestConfig, State>and implementasync *poll().ManifestConfigis generated from the manifest'sconfig.fieldsintosrc/gen/manifest.d.tsbydeno task generate(also run bycheckandbuild), so add config fields tomanifest.jsonand regenerate before reading them viathis.config. - Use
this.config,this.lastState, andthis.signal;onLoadis optional and can be async. - Stream pages and
yieldreal update batches as they are fetched. Persist a state cursor only after the batch it represents has been yielded. - Do not rely on class fields for cross-poll cache; each poll is a fresh runtime process.
- Extend
-
Update
manifest.json.- Keep
entrypointed at the committed build output, usuallydist/main.js. capabilitiesis required and non-empty; a polling/indexing data source must declare["data-source"].- Declare Gety compatibility via
min_gety_app_version(SemVer). schedulesupports{ "strategy": "manual" },{ "strategy": "interval", "interval_seconds": <n> }, or{ "strategy": "daily", "time": "HH:mm" }; omit it for Gety's default.- Use lowercase/snake_case author-facing fields and valid config field types.
- Do not add unsupported manifest fields such as
permissions,mode, dynamic per-doc hooks, or per-docdoc_link(it is declared once for the whole connector type).
- Keep
-
Validate locally and install in Gety.
- Run
deno task verifywhen available; otherwise run the closest equivalents: generate, format/check, lint, tests, and build. - If config requires secrets, tell the user to put them in
.envthemselves, using keys such asAPI_KEYorGETY_CONFIG_API_KEY; do not ask them to paste secrets into chat. - Use
deno task runner -- --reset-stateor repeated runner polls to verify emitted docs, deletes, state, and incremental behavior. - After the runner finishes, report the output directory (
dev/runs/<timestamp>/) and inspect key files. - Validate with CLI dry-run:
gety connector install <dir> --dry-run. - Install via CLI:
gety connector install <dir> [--config <file> | --set key=value](or guide user to install via Gety settings UI). - Check status:
gety connector show <connector_id>orgety connector list --kind custom. - Trigger sync:
gety connector poll <connector_id>. - After code changes, rebuild (
deno task build) and rungety connector restart <connector_id>. - Verify search:
gety search <query> -c "<connector_name>".
- Run
-
Add an icon.
- Once indexing is verified, give the connector a recognizable icon so it stands out in Gety's connector list and the install dialog.
- Drop an image (PNG or SVG) in the connector root — e.g.
icon.png— and set manifest"icon": "icon.png"(a relative path inside the connector root). Reuse the source's official logo when one exists.
Anti-Patterns
- Do not fetch every remote item into memory and yield once at the end.
- Do not write ephemeral signed URLs or temporary local cache paths into
doc_link. - Do not store large blobs in
metadata; put searchable/renderable text incontent. - Do not treat
metadata.updated_atas a fixed contract; usedoc_updated_at. - Do not read
this.config,this.lastState, orthis.signalfrom the class constructor — the host injects them after construction, so in the constructor they are still defaults (config{},lastStatenull, asignalthat never aborts). Read them inonLoadorpoll. - Do not edit generated
dist/main.jsby hand; editsrc/index.tsand rebuild.
Reference
- Load
references/gety-custom-connector-contract.mdfor manifest, SDK, document, link, state, runner, and Gety install/restart details.