Install Spectral
Add
@prismatic-io/spectral to your project as a dependency.Spectral requires TypeScript. If you have not configured TypeScript yet, see the installation guide for
tsconfig requirements.Create a component with one action
Create an The
index.ts file at the root of your component package. Use the component and action functions exported from Spectral to define your connector.index.ts
component function accepts a ComponentDefinition object. The key field must be unique within your Prismatic organization. Setting public: false limits the component to your organization.Define an input
Inputs are defined using the Common
input helper. Each input maps directly to a field shown in the integration builder UI.inputs.ts
type values include "string", "password", "boolean", "text" (multiline), "code", and "connection".Define a basic connection
Connections hold authentication credentials. Use the Register the connection on your component by adding it to the
connection function to define one and then attach it to your component.connection.ts
connections array:index.ts
Test the action locally
Spectral ships a Run your tests with your preferred test runner:
testing module with an invoke helper that runs your action’s perform function locally without deploying to Prismatic.Create a test file alongside your component source:index.test.ts
testing.invoke accepts the action definition directly, an object of input parameters, and an optional partial ActionContext. It returns { result, loggerMock } so you can also assert on log output.Next steps
Custom connectors
Learn about actions, triggers, data sources, and connections in depth.
Connections
Add OAuth 2.0 and on-prem connection support to your component.
Testing
Unit test actions, triggers, and data sources with the Spectral testing module.
Code-native integrations
Build full integrations in TypeScript using flows and config wizards.
