Skip to content

Write an external connector

A connector plugs an external service (Notion, Zapier, etc.) into an arka-deck project via the connectors-core module. It registers available actions, manages credentials/OAuth, and exposes an execution journal.


AspectAddonConnector
Core couplingConsumes core portsConsumes ConnectorRegistry + for-connectors
UI surfaceDedicated view, chat panel, etc.Configuration view + audit-log
AuthenticationLocal-onlyOAuth or external token
DataLocalExternal reference + cache

The notion-connect addon is the reference implementation to study.


addons/<connector>/
├── manifest.json
└── src/
├── index.ts # register + re-exports
├── manifest.ts # TS ConnectorManifest, re-exported by index
├── adapters/ # HTTP client, OAuth
├── actions/ # one action = one external operation
└── use-cases/

  1. Declare the ConnectorManifest in src/manifest.ts (slug, label, actions, OAuth scopes, etc.).
  2. Implement actions: each defines its input/output schema and handler.
  3. Handle authentication: in-memory OAuth state with short TTL, or encrypted static token.
  4. Register with the ConnectorRegistry in the composition root.
  5. Tests: individual actions (Zod schemas), OAuth flow (mock state), audit-log.

  • Secrets (tokens, credentials) encrypted via the SecretCipher port (AES-256-GCM, see ADR 0005).
  • OAuth state is ephemeral (short TTL, single use).
  • The connector never imports the whole target workspace: it stores only references and explicit executions.


This page is a stub. The full tutorial (connector skeleton, Zod schemas, audit-log, error handling) will be written during lot P4 from the addons/notion-connect/ code.