Developers

Integration templatesDraft

Each way to build an integration has a template on GitHub. Press Use this template to make your own repository, then change it with this page beside you. The calls, their shapes and limits come from the 1weavr protocol.

Every call

A call carries protocol, call, a unique delivery id, the integration, the installation and its input. The answer repeats call and delivery and is { ok: true, output, effects? } or { ok: false, error: { code, message } }; code is refused, failed, unauthenticated or rate_limited, and message is shown to people as written. An answer of the wrong shape is refused and logged.

send.file is never retried, since a second try could send twice. When its outcome is unknown, send.find is called with the same marker; the marker is the last line of markdown (Ref <marker>), so whatever you create must keep it.

Declarative

integration-template-declarative files a capture as an issue in your tool. There is no code: each call is a request template and a response mapping in manifest.json.

CallAnswered byInputOutputLimit
connection.verifyactions.whoAmInothing; the connection’s site, email and api_token fill the request{ account }, shown as “Connected as …”10 s, no retry
lookuplookups.projects, issueTypes, people, labels{ lookup, query, cursor, target?, values }{ items: [{ value, label }], next }5 s, no retry
send.fileitem.actions.file → actions.createIssue{ target, report, markdown, outcome, values, marker }{ outcome: "issue", target, ref: { scheme: "key", key }, url }120 s, never retried
send.finditem.actions.find → actions.findByMarker{ target, marker, outcome, since }{ found: true, outcome, target, ref, url } or { found: false }120 s, no retry

Sandbox

integration-template-sandbox adds a capture as an entry on a page in your tool. The logic is one ES module, index.js, with no imports; each export is (input, host) => output, and host.fetch is its only way out. A thrown error with an HTTP status answers an error: 401 is unauthenticated; 403, 404 and 422 are refused; 429 is rate_limited; anything else is failed.

CallAnswered byInputOutputLimit
connection.verifywhoAmInothing{ account }10 s, no retry
lookup (pages)pages{ lookup, query, cursor, values }{ items: [{ value, label }], next }5 s, no retry
send.fileaddEntry{ target, report, markdown, outcome, values, marker }{ outcome: "entry", target, ref: { scheme: "id", id }, url }120 s, never retried
send.findfindEntry{ target, marker, outcome, since }{ found: true, outcome, target, ref, url } or { found: false }120 s, no retry

Remote

integration-template-remote tells your server when a capture is made or fixed and shows the facts it answers on each capture. Every call is an HTTPS POST to runtime.endpoint. event.deliver is retried, so the same event.id can arrive twice: handle it once. It declares no connection, so installing it asks nobody to sign in to your service.

CallAnswered byInputOutputLimit
event.deliver (item.made)events.out → actions.onMade{ event: { id, type, at }, item }{}, optionally with activity.add effects10 s, 6 retries
event.deliver (item.fixed)events.out → actions.onFixedthe same, with event.type "item.fixed"{}, optionally with activity.add effects10 s, 6 retries
zone.render (item.facts)item.facts.render → actions.deployFacts{ zone, subject, item }{ blocks: [{ type: "fact", name, value }], ttl }3 s, no retry

Security

What 1weavr enforces for every integration:

  • Hosts. A request reaches only a host in hosts, for the uses listed there; anything else is blocked before it leaves and recorded in the Log.
  • Secrets. A secret enters a request only through a ${secret.<name>} hole 1weavr fills, for a host that names it under secrets, and in a body only on an auth host. Your manifest and code never hold the value.
  • Masking. Secret values are masked in the Log and the developer console, in headers and bodies.
  • Consent. Admins approve the permissions and hosts when they install. A version that adds a permission, host, secret, event or effect is a major version, and admins approve it before it runs.
  • Publisher secrets are sealed in your integration's Environments, Test and Live apart, and never shown again once saved.

What you are responsible for:

  • Ask for the least. Only the hosts, uses and permissions you need; exact hosts, never a broad wildcard.
  • No real secrets in the repository. Test cases use stand-in values such as fixture-token.
  • Words people read. An error message never carries a token, a URL with a key, or an internal detail.
  • One send, one result. Keep the marker in what you create so send.find finds an earlier try.
  • Input is data. Capture titles, notes and addresses come from people: escape them where your tool shows them.

Report a vulnerability privately to hello@1weavr.com.

How to write the manifest and test it: Build an integration.