Skip to main content
Use addFacts() to attach contextual facts to the current interaction.
Applies to Web Component, Window API, and PostMessage. Examples on this page use the Web Component API shape.

Usage

Prerequisites

  • User must be authenticated.
  • An interaction must already exist.

Input validation

  • Web Component / React: pass an array of facts.
  • Window API / PostMessage: pass { facts: [...] }.
  • facts[].text: Required, non-empty string.
  • facts[].group: Optional string, defaults to "other".
  • facts[].source: Optional, defaults to "user".

Possible errors

  • NOT_READY: No active interaction.
  • UNAUTHORIZED: User not authenticated.
  • INVALID_PAYLOAD: Empty facts array or missing text field.
  • INTERNAL_ERROR: Failed to save facts.

Returns

void

Patient gender guidance

In languages where patient gender affects phrasing in documentation, provide a clear sentence in the target document language through addFacts(). Common German examples: