DC VS Code Extension
VS Code support for building and testing connectors against the Data Connector platform. It lists test credentials from the hosted API, runs the same authenticate → get_objects → get_fields / get_data flow as the platform UI through your local workspace HTTP server, and opens webviews for credential detail and object field inspection.
Requirements
- Data Connector API reachable at the origin you configure (default
https://dev.dataconnector.com). You need a valid access token and a connector UUID.
- Local connector / workspace server (default
http://127.0.0.1:5001) exposing POST /invoke for authenticate, get_objects, get_fields, and get_data, matching your connector template. Set the workspace API key if your server requires it.
- VS Code
^1.110.0 (see engines in package.json).
Test Connection view
Open the Explorer sidebar and find Test Connection (contributed under the Explorer views).
- If anything is missing, the tree shows actions: set API base URL, connector ID, or access token.
- After configuration, the tree loads credentials from
GET /api/connector/{connectorId}/credential?test=true.
- Click a credential to test connection. The extension:
- Fetches decrypted invoke credentials from the API
- Calls your workspace server:
authenticate, then get_objects
- On success, expand the credential to see objects. Click an object (with a resolvable
object_id) to open object fields in a webview (loads fields and sample data via get_fields / get_data).
- Use the view title actions Refresh and Set connector ID as needed.
Errors from the connector appear under the credential with optional raw invoke payloads in the tooltip.
Commands (Command Palette)
All commands use the category Data Connector:
| Command |
Purpose |
| Refresh |
Reloads the Test Connection tree |
| Set connector ID |
Prompts for the connector UUID; saved to workspace settings when a folder is open, otherwise user settings |
| Open credential detail |
Opens the credential detail webview; requires connectorId and credentialId arguments (e.g. from another extension or a keybinding) |
| Test connection |
Runs the workspace flow for a credential (normally triggered from the tree) |
| Open object fields |
Opens the object fields webview; requires session/object arguments (normally triggered by clicking an object in the tree) |
| Set Data Connector access token |
Stores the token in VS Code Secret Storage |
| Set workspace server API key |
Stores the key in VS Code Secret Storage |
| Open Data Connector settings |
Opens Settings filtered to dc.dataConnector |
Extension settings
| Setting |
Default |
Description |
dc.dataConnector.apiBaseUrl |
https://dev.dataconnector.com |
Data Connector API origin (no trailing slash) |
dc.dataConnector.connectorId |
(empty) |
Connector UUID for /api/connector/{id}/... |
dc.dataConnector.apiKeyHeader |
x-data-connector-access-token |
Header name for the Data Connector access token |
dc.workspaceServer.baseUrl |
http://127.0.0.1:5001 |
Local workspace server origin (no trailing slash) |
dc.workspaceServer.apiKeyHeader |
x-api-key |
Header name for the workspace server secret |
dc.workspaceServer.healthPath |
/health |
Path used for health-related checks / samples |
Changing dc.dataConnector.* refreshes the Test Connection view automatically.
Secrets
Sensitive values are not stored in settings.json. They use VS Code’s Secret Storage:
- Data Connector access token — sent with
dc.dataConnector.apiKeyHeader
- Workspace server API key — sent with
dc.workspaceServer.apiKeyHeader
Set them via the Command Palette commands above.
Development
cd apps/dc-vscode-ext
npm install
npm run compile
- Watch:
npm run watch
- Package for publish:
npm run package (runs typecheck, lint, production esbuild)
In VS Code, open this folder and use Run Extension (F5); launch.json runs the npm: compile extension preLaunch task.
Scripts
| Script |
Description |
compile |
Typecheck, lint, bundle with esbuild |
package |
Same as compile with production flags (used by vscode:prepublish) |
lint |
ESLint on src |
check-types |
tsc --noEmit |
test |
@vscode/test-electron test runner |
Further reading