Code vs Custom Components

Overview

Prismatic offers a wide array of 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 integration 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 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 component with two actions:

  1. Serialize a .rocket file to JSON
  2. Deserialize a JSON file to .rocket

To create a custom component, we recommend working through the Your First Custom Component tutorial to observe how the Slack component functions. Then, reference Writing Custom Components to write your own component.

For advanced topics, like handling credentials or binary data, read Advanced Custom Components to see how the AWS S3 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 three things: reusability, complexity, and credentials required.

  • 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.
  • Credentials: If your code handles API keys or other credentials, you will need to use 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 component development. Documentation on Spectral is available here.

Last updated on