Build reusable, typed connectors that integrate third-party APIs with Prismatic using the Spectral SDK.
A custom connector (called a component in Prismatic) is a self-contained package of actions, triggers, data sources, and connections that you publish to Prismatic and use inside low-code integrations or code-native integrations.Connectors are written in TypeScript using the Spectral SDK (@prismatic-io/spectral). Each connector is defined by calling component(), which accepts a ComponentDefinition object.
type ComponentDefinition<TPublic extends boolean, TKey extends string> = { /** Unique programmatic key for this component. */ key: TKey; /** Whether this component is available to all orgs (only Prismatic-managed public components use true). */ public?: TPublic; /** How this component appears in the Prismatic UI. */ display: ComponentDisplayDefinition<TPublic>; /** Named actions this component exposes. */ actions?: Record<string, ActionDefinition<any, any, boolean, any>>; /** Named triggers this component exposes. */ triggers?: Record<string, TriggerDefinition<any, any, boolean, any> | PollingTriggerDefinition<any, any, any, any, any, any>>; /** Named data sources this component exposes. */ dataSources?: Record<string, DataSourceDefinition<any, any, any>>; /** Connection definitions used by this component's actions. */ connections?: ConnectionDefinition[]; /** Optional global hooks (e.g., a component-wide error handler). */ hooks?: ComponentHooks; /** Documentation URL. Required for public Prismatic components; optional for custom. */ documentationUrl?: string;};
The display field uses ComponentDisplayDefinition:
type ComponentDisplayDefinition<TPublic extends boolean> = { label: string; // Human-readable name shown in the UI description: string; // Short description of what this connector does iconPath: string; // Path to icon file relative to built source category?: string; // Optional grouping category};
All keys (key on component, action, connection, etc.) must be unique within their scope and should use camelCase. They are programmatic identifiers used in the Prismatic API and cannot be changed after publishing.