A connection defines how integration builders authenticate with a third-party service. Connections are attached to a component via the connections array in component() and are referenced by actions and triggers via a connection input.
Spectral provides four functions for defining connections:
Standard connections
Use connection() for connections backed by static credentials such as API keys or username/password pairs.
ConnectionDisplayDefinition supports an optional icons object for customizing the appearance of the connection card:
API key example
Username and password example
ConnectionInput is a subset of InputFieldDefinition with two additional fields:
OAuth 2.0 connections
Use oauth2Connection() for OAuth 2.0 flows. Prismatic handles the token exchange and refresh automatically.
OAuth2Type enum
Authorization Code
Client Credentials
Authorization code flow redirects the user to the third-party login page to grant access. Client credentials flow exchanges a client ID and secret for an access token without user interaction.
OAuth2UrlOverrides
You can override the Prismatic OAuth 2.0 redirect URIs using oauth2Config on an authorization code connection:
PKCE support
To enable PKCE (Proof Key for Code Exchange) on an authorization code connection, set oauth2PkceMethod:
OAuth2PkceMethod has two values:
On-prem connections
Use onPremConnection() when the third-party service runs inside a customer’s private network. Prismatic replaces the host and port values with a local tunnel endpoint when the on-prem agent is active.
templateConnectionInputs() merges your custom inputs with template (hidden) inputs that are computed from other field values. This is useful for constructing a full URL from a base URL template without exposing the computed value to users:
Reading connection values in actions
When a user configures a connection, the field values are available via the connection input parameter in the action’s perform function:
Never log connection field values. The password type is masked in the Prismatic UI but the raw value is accessible in the perform function. Use context.logger only for non-sensitive metadata.