The TypeScript SDK is the public package every GCS plugin imports. It hides the postMessage envelope shape and gives you a typedDocumentation Index
Fetch the complete documentation index at: https://docs.altnautica.com/llms.txt
Use this file to discover all available pages before exploring further.
PluginContext instead.
Install
The standalone npm publish lands with the hosted registry. Until then the supported workflow is to develop your plugin inside thealtnautica/ADOSExtensions
monorepo as a pnpm workspace member; the SDK resolves via
workspace:^ against the in-tree
packages/plugin-sdk.
The Quickstart walks through the clone and
scaffold flow.
The package is a peer of the host iframe runtime. It has no runtime
dependencies and ships ESM only.
definePlugin
The single entry point:
mount is awaited; if it throws, the host receives a handler_error
envelope and surfaces it in the install dialog.
info is optional. Most plugins write async mount(ctx) and ignore
it; the second argument carries the host build version, the
plugin’s resolved permission set, and the operator-edited config.
The same pattern applies to unmount.
PluginContext
The argument the SDK hands to mount:
ctx.client.request(method, capability, args) for any RPC the
helpers do not expose.
PluginClient
The lower-level RPC client:
request(method, capability, args, options?): send a request and await the response. Default timeout 5s.on(method, handler): subscribe to host-pushed events.subscribeTelemetry(topic, handler): convenience that does bothrequest("telemetry.subscribe", ...)andon("telemetry.<topic>", ...).dispose(): tear down listeners and reject in-flight RPCs.
HostError
Thrown by client.request when the host returns an error envelope:
code field is the machine-readable error code from the
envelope. The message is human-readable; do not branch on it.
Test harness
- mounts the plugin against an in-memory transport (no real iframe);
- captures every RPC in
harness.calls, grouped helpers inharness.notificationsandharness.recordingMarks; - accepts
pushTelemetry,pushEvent,pushConfig,pushTheme; - supports
failNext(method, code, message)to simulate host failures; - mirrors the real bridge’s capability gate.
Building the bundle
The SDK does not ship a build step. Plugin repos use esbuild, Vite, or any other bundler that emits ESM. Thecreate-ados-plugin
template uses esbuild for zero-config builds:
gcs/plugin.bundle.js. The manifest’s gcs.bundle
field points at the same path. The pack script computes the
SHA-256 and writes it into assets[].sha256.