Developers

Build an integrationDraft

When the integration you need is not in Settings → Integrations, build it: send captures to a tool we do not support, show your own data on a capture, or have 1weavr call your server when something happens. It installs like any other, in your workspace only.

The four steps

  1. Pick how it runs: declarative, sandbox or remote (below).
  2. Write it: a manifest, starting from a template.
  3. Test it on a capture: fixtures, then the console under Settings → Developers.
  4. Publish, then install: an admin agrees to exactly what it asks for.

Pick how it runs

You write, and where it runsGood for
DeclarativeA manifest: the HTTP calls, and which capture fields go where. Runs on our servers.A tool with a plain REST API.
SandboxA manifest and one JavaScript file. Runs in a sandbox we host that reaches only the hosts you list.Logic between calls: reshaping data, calling two APIs.
RemoteA manifest and an HTTPS endpoint you host. We POST signed JSON to it.Being told when a capture is made, sent or fixed.

The manifest

Building and testing the organisation's own integrations needs the role that may build and a Hands-on or Avid seat (Plans and seats).

One JSON file says everything the integration is: where it shows (zones), which hosts it may reach and why, how it connects, and what each call does. Below, a declarative one that adds a fact to every capture.

{
  "protocol": 2,
  "id": "your-tab",
  "name": "Your tab",
  "runtime": { "kind": "declarative" },
  "hosts": [{ "host": "api.your-tool.example", "use": ["fetch"],
              "secrets": ["api_token"], "reason": "Reading what happened on the page." }],
  "connection": { "kind": "token", "owner": "workspace", "verify": "whoAmI",
                  "fields": [{ "key": "api_token", "label": "API token", "kind": "text", "secret": true }] },
  "contributes": { "item.facts": { "render": "errorFacts",
                   "input": { "item": "summary", "diagnostics": false, "project": false } } },
  "actions": { "errorFacts": { "request": { "method": "GET", "url": "https://api.your-tool.example/v1/summary" },
               "result": { "blocks": "[{ type: 'fact', name: 'Errors nearby', value: to_string(body.count) }]" } } },
  "permissions": ["items.read"]
}
  • contributes: the places it appears. item.facts is the facts list on a capture; item.actions is Send to.
  • hosts: the only addresses it may call, each with its reason. A secret reaches only the hosts that name it.
  • permissions: you do not choose them. They follow from the zones and events you use, and a manifest whose list differs is refused.

Templates

Each way to build has a template on GitHub. Press Use this template to make your own repository; each holds manifest.json, an icon, fixtures/, and a short README. The calls each answers and the security rules are in Integration templates.

TemplateWhat it does
integration-template-declarativeFiles a capture as an issue in your tool. No code.
integration-template-sandboxAdds a capture as an entry on a page in your tool, from one JavaScript file.
integration-template-remoteTells your server when a capture is made or fixed, and shows the facts it answers.

Values and secrets

Your integration's own values (a client id) and secrets (a partner key) go in Settings → Developers → your integration → Environments. Define each one there, as a plain value or a secret; Test is what the console uses and Live is what installations use. A manifest reads them as ${publisher.client_id} and ${secret.publisher.partner_key}, and a secret is sealed once saved and never shown again.

Test it on a capture

A fixture is one call with the tool's answers written down: what goes in, what the tool replies, and what must come out. Fixtures are your test suite, and they are the saved cases the console runs.

{
  "name": "Facts on CAP-128",
  "call": "zone.render",
  "input": { "zone": "item.facts", "subject": { "kind": "item", "id": "c_128" }, "item": { … } },
  "secrets": { "api_token": "fixture-token" },
  "http": [{ "match": { "method": "GET", "url": "https://api.your-tool.example/v1/summary" },
             "respond": { "status": 200, "body": { "count": 12 } } }],
  "expect": { "blocks": [{ "type": "fact", "name": "Errors nearby", "value": "12" }] }
}

In Settings → Developers, open your integration, pick a saved case and press Run. You see each request it would make, what went in (capture content left out), what came back, and whether it matched. Every run is also in the installation's log.

Install it

An admin installs it from Settings → Integrations. The install sheet lists what it may do, the only hosts it reaches, what it never sees and which projects it is for; the yes is recorded for exactly that version. See permissions.