Code vs Custom Components
Prismatic offers a wide array of built-in components to accomplish a variety of things, like serializing data formats, invoking REST endpoints, or interacting with commonly-used SaaS platforms like AWS, Slack, or Dropbox. The majority of your integrations can likely be developed using these standard components.
For the portions of your integrations that are specific to your industry or product, we provide the ability to run custom code as part of your integration. You can deploy your own code in the form of reusable custom components or short code component steps.
Custom components
Custom components are reusable portions of related code that can be utilized by several of your integrations. A custom component is developed as a node package, and is comprised of one or more actions that can be added to an integration.
For example, Progix Software might support a proprietary data format, .rocket
, for rocket schematics.
Progix might create a custom component with two actions:
- Serialize a
.rocket
file to JSON - Deserialize a JSON file to
.rocket
To create a custom component, we recommend working through the Component Getting Started Guide tutorial. Then, reference Writing Custom Components to write your own custom component.
For advanced topics, like handling connections or binary data, read Advanced Custom Components to see how the Amazon S3 built-in component addresses advanced component concepts.
The code component
The code component is used for smaller, integration-specific proprietary code. If a problem cannot be solved with built-in components, but can be solved with a few lines of JavaScript, the code component is a good choice for you.
To see usage and a few use cases for the code component, see Code Component Usage.
When should I use a custom component vs a code component?
Most platform-specific problems can be solved either way: with custom components or with the code component. When choosing which is right for your situation, consider two things: reusability and complexity.
- Reusability: If you are writing code that could be reused in multiple integrations, you should write a custom component.
- Complexity: If your code is sufficiently complex that you would benefit from unit testing, strongly typed variables, etc., you should write a custom component.
If your code is integration-specific, not terribly complex, and not dependent on Prismatic's credential store, a code component will be sufficient for you.
The custom component library
The custom component library, which we refer to as Spectral, provides TypeScript type definitions for use in custom component development. Documentation on Spectral is available here.