Skip to main content

What is Spectral?

Spectral is Prismatic’s open-source TypeScript library for building custom connectors and code-native integrations on the Prismatic embedded iPaaS platform. With Spectral, you can:
  • Build custom connectors (components) with actions, triggers, data sources, and connections that appear natively in the Prismatic integration designer
  • Write code-native integrations entirely in TypeScript, deploying them directly to Prismatic without using the low-code designer
  • Define OAuth 2.0 connections, on-prem connections, and standard API key connections
  • Unit test your connectors and integrations locally before publishing

Quickstart

Build and publish your first custom connector in minutes

Installation

Install Spectral and set up your development environment

Custom Connectors

Learn how to build type-safe connectors with actions, triggers, and connections

Code-Native Integrations

Write complete integrations in TypeScript with full IDE support

Two ways to build with Spectral

Custom connectors (components) are reusable building blocks that appear in the Prismatic low-code integration designer. They expose actions, triggers, data sources, and connections that integration builders can use without writing any code.Use custom connectors when:
  • You need to connect to an API not covered by Prismatic’s built-in connectors
  • You want to encapsulate reusable business logic as a connector
  • Non-developers will build integrations using your connector
import { component, action, input, connection } from "@prismatic-io/spectral";

export default component({
  key: "my-api",
  display: {
    label: "My API",
    description: "Connect to My API",
    iconPath: "icon.png",
  },
  actions: { getUser },
  connections: [myConnection],
});

Key features

Full TypeScript Support

Complete type definitions for all APIs. Get autocompletion, type checking, and inline documentation in your IDE.

OAuth 2.0 Connections

Built-in support for OAuth 2.0 authorization code and client credentials flows, including PKCE.

HTTP Client

Built-in Axios-based HTTP client with automatic retry, authorization header injection, and multipart form support.

Testing Utilities

Unit test actions, triggers, data sources, and flows locally with mock contexts and logger assertions.

On-Prem Connections

Support for on-premises connections that route through Prismatic’s on-prem agent.

Polling Triggers

Scheduled polling triggers with state management for detecting new events in APIs that lack webhooks.

Package overview

The @prismatic-io/spectral npm package exports the following top-level APIs:
ExportPurpose
componentDefine a custom connector
actionDefine an action within a connector
triggerDefine a trigger within a connector
pollingTriggerDefine a polling trigger
dataSourceDefine a data source
inputDefine an input field
connectionDefine a standard connection
oauth2ConnectionDefine an OAuth 2.0 connection
onPremConnectionDefine an on-prem connection
integrationDefine a code-native integration
flowDefine a flow within a code-native integration
configPageDefine a config wizard page
configVarDefine a configuration variable
utilType coercion and utility functions
testingUnit testing helpers

Learn more

Custom Connectors

Actions, triggers, inputs, connections

Code-Native

Flows, config wizards, endpoint config

Testing

Unit testing your connectors and flows