Overview

Capabilities

Capabilities let Tecton modules communicate with the platform they're embedded in. Use Actions to trigger platform behaviors, and Sources to access platform data.

Capabilities require an extension built with q2-tecton-sdk and a connection to a platform built with q2-tecton-platform.
Isolated Boundary
actionRequired()cacheCleared()callMethod()canUser()clearCache()getModuleInfo()clearParams()getQRCode()
actionRequired()cacheCleared()callMethod()canUser()clearCache()getModuleInfo()clearParams()getQRCode()
Platform
Tecton
Extension
How availability works

The platform tells you what's available

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');
Typed and predictable

Every capability call is typed, async, and predictable

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 code

Actions

Tell the platform to do something — navigate, show a modal, set the title, and more. Side effects expected.

Sources

Read data from the platform — account data, user context, platform state. No side effects.

Methods

The connect() call that initializes the SDK and negotiates the capability contract between your module and the platform.