io.intents API

The Intents API for late-binding, action-based workflow orchestration.

register()

Dynamically register an intent handler. Intents can also be registered statically in the app definition JSON.

io.intents.register(intentName: string, handler: (context) => void): void
Example
io.intents.register("ViewChart", (context) => {
  console.log("Instrument:", context.data.ticker);
});

raise()

Raise an intent to be handled by a registered app. If multiple handlers exist, the Intent Resolver UI is shown.

io.intents.raise(request: IntentRequest): Promise<IntentResult>
ParameterTypeDescription
request.intentrequiredstringIntent name (e.g., "ViewChart").
request.contextrequiredobjectContext data with type and id.
request.targetstring"startNew" or "reuse". Omit to let the platform decide.
Example
await io.intents.raise({
  intent: "ViewChart",
  context: {
    type: "fdc3.instrument",
    id: { ticker: "MSFT" },
  },
  target: "startNew",
});

find()

Find all registered intent handlers for a given intent name.

io.intents.find(intentName: string): Promise<IntentHandler[]>