Skip to main content

Syntax

addToContext(key, value, mode)

Description

Adds a value to the Context object. Parameters:
  • key: string — the key in the Context object where the value should be stored.
  • value: unknown — the value to store.
  • mode: "simple" | "array":
    • "simple" — stores the value directly at the specified key, replacing any existing value.
    • "array" — adds the value to an array at the specified key, creating the array if it doesn’t exist.
Returns: void

Example

Last modified on April 21, 2026