Overview
Capabilities let Tecton modules communicate with the platform they're embedded in. Use Actions to trigger platform behaviors, and Sources to access platform data.
q2-tecton-sdk and a connection to a platform built with q2-tecton-platform.When your extension connects to a Q2 platform, the platform advertises the capabilities it supports. Your extension only sees — and can only call — what that platform has made available. connect() is where this negotiation happens; after that, the capabilities you have are the capabilities that the platform supports.
import { connect } from 'q2-tecton-sdk';
// connect() returns the advertised capability set
const { actions, sources } = await connect();
// only what this platform supports is present
actions.navigateTo?.('accounts');
const allowed = await sources.canUser?.('transfer');Capability calls follow a consistent contract: you pass a typed request, and you always get the same response shape back — { response, status, statusText }. The wrapper is predictable regardless of platform. What lives inside response is platform-specific data — your extension knows what it asked for.
// typed route + method, consistent response shape
const result = await sources.requestPlatformData?.({
route: '/accounts/acct_123',
method: 'GET'
});
// response is always { response, status, statusText }
result?.response.balance; // your data
result?.status; // HTTP status codeTell the platform to do something — navigate, show a modal, set the title, and more. Side effects expected.
Read data from the platform — account data, user context, platform state. No side effects.
The connect() call that initializes the SDK and negotiates the capability contract between your module and the platform.