InteractionContext

The thread, message reference, typed action value, user, and capabilities passed to a component callback.


Buttons, selects, and inputs receive an InteractionContext<TValue>.

Shape

interface InteractionContext<TValue = unknown> {
  thread: Thread;
  message: IncomingMessage;
  action: {
    id: string;
    value?: TValue;
  };
  values: Record<string, unknown>;
  user: ApplicationUser | null;
  actor: ProviderActor;
  platform: string;
  openModal?(view: ModalView): Promise<{ ok: boolean; error?: string }>;
}
FieldNotes
threadPost, update, or resume the current conversation.
messageMessage containing the control. Check message.ref.id before updating it.
action.idOpaque SDK action id.
action.valueRound-tripped Button.value, selected value, or submitted text. Guard undefined.
valuesOther submitted form values. Teams Action.Submit callbacks include named Adaptive Card input values.
userNullable application user selected by identifyUser.
actorProvider account that caused the interaction.
platformNative provider; managed callbacks report "slack" or "teams".
openModalCapability-gated and omitted on the managed Slack and Teams path.
<Button
  value={{ approved: true }}
  onClick={async ({ thread, message, action }) => {
    if (action.value === undefined) return;

    if (message.ref.id) {
      try {
        await thread.update(message.ref, "Approved");
      } catch {
        // Best-effort visual update.
      }
    }

    await thread.resume(action.value);
  }}
>
  Approve
</Button>

Managed interactions arrive as a later delivery. Return after posting the original control and use resume() in its callback; do not block with awaitChoice().