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