Triggo Documentation
SDK

Connector SDK Overview

Build custom integrations for Triggo using the Connector SDK. Covers architecture, installation, and the core API surface.

Connector SDK Overview

The @triggo/connector-sdk package provides the building blocks for creating custom connectors that integrate external services with Triggo pipelines.

Architecture

A connector is a self-contained package that declares:

  • Authentication -- how users connect their account (OAuth2, API key, custom fields, or none)
  • Actions -- operations the connector can perform (e.g., send a message, create a record)
  • Triggers -- events the connector listens for (e.g., new message received, record updated)
Connector
├── Auth (OAuth2 | SecretText | Custom | None)
├── Actions[]
│   ├── Props (input fields)
│   └── run(context) → result
└── Triggers[]
    ├── Props (input fields)
    ├── onEnable(context) → void | OnEnableResult
    ├── onDisable(context) → void
    └── run(context) → events[]

Installation

pnpm add @triggo/connector-sdk @triggo/shared

Core Exports

ExportKindPurpose
createConnectorFactoryAssemble a connector from auth + actions + triggers
createActionFactoryDefine an action with typed props and a run function
createTriggerFactoryDefine a trigger with lifecycle hooks
ConnectorAuthNamespaceAuth type constructors (OAuth2, SecretText, CustomAuth, None)
PropertyNamespaceInput property constructors (11 types)
ConnectorErrorClassStructured error with error code and retryable flag
TRIGGER_TYPESConstant{ WEBHOOK, POLLING }
AUTH_TYPESConstant{ OAUTH2, SECRET_TEXT, CUSTOM, NONE }

Minimal Example

import {
  createConnector,
  createAction,
  ConnectorAuth,
  Property,
} from "@triggo/connector-sdk";

const greet = createAction({
  name: "greet_user",
  displayName: "Greet User",
  description: "Returns a greeting for the given name.",
  props: {
    name: Property.ShortText({
      displayName: "Name",
      description: "The name to greet.",
      required: true,
    }),
  },
  async run(context) {
    const name = context.propsValue.name as string;
    return { greeting: `Hello, ${name}!` };
  },
});

export const myConnector = createConnector({
  name: "my-service",
  displayName: "My Service",
  description: "A minimal connector example.",
  auth: ConnectorAuth.None(),
  actions: [greet],
  triggers: [],
});

Naming Conventions

EntityRuleExample
Connector namekebab-casemy-service
Action namesnake_casesend_message
Trigger namesnake_casenew_message

Names are validated at creation time. Invalid names throw an Error.

SDK Pages

On this page