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/sharedCore Exports
| Export | Kind | Purpose |
|---|---|---|
createConnector | Factory | Assemble a connector from auth + actions + triggers |
createAction | Factory | Define an action with typed props and a run function |
createTrigger | Factory | Define a trigger with lifecycle hooks |
ConnectorAuth | Namespace | Auth type constructors (OAuth2, SecretText, CustomAuth, None) |
Property | Namespace | Input property constructors (11 types) |
ConnectorError | Class | Structured error with error code and retryable flag |
TRIGGER_TYPES | Constant | { WEBHOOK, POLLING } |
AUTH_TYPES | Constant | { 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
| Entity | Rule | Example |
|---|---|---|
| Connector name | kebab-case | my-service |
| Action name | snake_case | send_message |
| Trigger name | snake_case | new_message |
Names are validated at creation time. Invalid names throw an Error.
SDK Pages
- Create a Connector --
createConnector()API reference - Create an Action --
createAction()API reference - Create a Trigger --
createTrigger()API reference - Authentication -- OAuth2, SecretText, Custom, None
- Properties -- 11 property types for declaring inputs
- Context and Store -- Runtime context and persistent storage
- Error Handling --
ConnectorError, error codes, retry behavior - Full Example -- End-to-end connector walkthrough