Creates a connection config variable for code-native integrations.
The connectionConfigVar() function defines a config variable that holds a connection — a set of authentication credentials (API key, OAuth token, username/password, etc.) used to authenticate with an external service. Connection config variables always have dataType: "connection".A connection config var can be defined in two ways:
Connection definition — inline definition with explicit inputs fields (used when building a connection from scratch within a code-native integration).
Connection reference — a reference to a connection defined in a component registered in the componentRegistry (used when reusing an existing component’s connection type).
The input fields that make up the connection (e.g., apiKey, baseUrl, username, password). Each value is an input field definition combined with optional visibility settings.
The same connection config variable definition object passed in, unchanged. Used for type inference.
At runtime, the value of a connection config variable is available as a Connection object in context.configVars. It contains the resolved input values and can be passed directly to component actions or used in your own HTTP client setup.
Customer-activated and organization-activated connections
For integration-agnostic connections, use the dedicated helper functions instead of connectionConfigVar():
customerActivatedConnection({ stableKey }) — Creates a customer-activated connection config var (customers configure the connection themselves).
organizationActivatedConnection({ stableKey }) — Creates an org-activated connection config var (the organization configures the connection, not the customer).
These are placed in scopedConfigVars on the integration definition rather than in configPages.
import { integration, organizationActivatedConnection,} from "@prismatic-io/spectral";export default integration({ name: "My Integration", flows: [], scopedConfigVars: { "Shared API Connection": organizationActivatedConnection({ stableKey: "shared-api-connection", }), },});