getContext - Cognigy Documentation

Syntax

getContext(key)

Description

Retrieves the value associated with a given key in the Context object.Parameters:

Returns:unknown — the value stored at the specified key in the Context object, or undefined if the key doesn’t exist.

Example

const userName = getContext("user.profile.name");
log(`User name is: ${userName}`);