Bridge Configuration
Bridges support two integration types: API (REST/GraphQL) and NPM (SDK packages). Each has its own configuration structure.
API Bridge Config
For bridges that call REST or GraphQL APIs directly:
interface ApiBridgeConfig {
type: 'api';
baseUrl: string;
authType: 'api_key' | 'oauth2' | 'basic' | 'bearer';
authConfig: {
headerName?: string; // For API key auth
tokenUrl?: string; // For OAuth2
};
rateLimiting?: {
requestsPerSecond: number;
retryAfterHeader?: string;
};
endpoints: Record<string, ApiEndpointConfig>;
}Endpoint Config
Each endpoint maps to an API call:
| Field | Type | Req | Description |
|---|---|---|---|
| method | 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | HTTP method | |
| path | string | URL path (supports template variables) | |
| description | string | Human-readable description | |
| queryParams | Record<string, string> | Default query parameters | |
| bodyTemplate | Record<string, unknown> | Request body template | |
| responseMapping | object | JSONPath mapping for data extraction |
NPM Bridge Config
For bridges that use an npm SDK package:
interface NpmBridgeConfig {
type: 'npm';
packageName: string;
packageVersion?: string;
clientInitialization: string;
methodMappings: Record<string, NpmMethodMapping>;
}Method Mapping
Maps bridge tasks to SDK methods:
{
'grab-orders': {
method: 'client.orders.list',
parameterMapping: { since: 'created_at_min' },
responseMapping: { dataPath: 'orders' },
}
}Runtime Config
At execution time, bridges receive a BridgeRuntimeConfig:
interface BridgeRuntimeConfig {
credentials: Record<string, string>;
settings?: Record<string, unknown>;
}credentials contains the values from the bridge’s configFields that are of type password or text. These are the sensitive values like API keys and tokens.
settings contains any additional non-credential configuration, such as selected warehouse IDs or sync preferences.