Install the package
Spectral is published to npm as@prismatic-io/spectral. Install it as a regular dependency — it is required at runtime for compiled connectors and integrations.
10.16.5. Check npm for the latest release.
TypeScript configuration
Spectral is written in TypeScript and ships its own type definitions. Your project must use TypeScript to get accurate type checking and IDE autocompletion. Create or update yourtsconfig.json with the following recommended settings:
tsconfig.json
Dev environment setup
Node.js version
Spectral requires Node.js 18 or later. Use a version manager such as nvm or fnm to manage Node.js versions across projects.Recommended project structure
A typical custom connector project has the following layout:Test runner
Spectral’stesting module works with any test framework. The Spectral package itself uses Vitest. To use Vitest in your connector project:
npm
package.json:
package.json
Available binary tools
Spectral ships two CLI binaries that become available in yournode_modules/.bin directory after installation.
component-manifest
Generates a type-safe TypeScript manifest for a custom component. The manifest is used to get full type checking and autocompletion when referencing your component’s actions from code-native integrations.
cni-component-manifest
Generates a component manifest specifically for code-native integrations (CNI). Use this when your code-native integration references other Prismatic components and you want compile-time safety over those component actions.
Workspace and monorepo setup
If you maintain multiple connectors or a connector alongside code-native integrations, a monorepo layout keeps dependencies and build tooling centralized.npm workspaces
package.json
Sharing inputs and connections across packages
Common inputs and connection definitions can live in a shared internal package:TypeScript project references
For faster incremental builds in a monorepo, use TypeScript project references:packages/connector-a/tsconfig.json
When using project references, set
"composite": true and "declaration": true in each referenced package’s tsconfig.json.Next steps
Quickstart
Build a working component with an action, connection, and local test in minutes.
Custom connectors
Deep dive into actions, triggers, data sources, and connections.
