Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
function sessionExitPoint(data) {
  const sessionId = data.sessionId;
  const identity = data.identity;
  // logic to retrieve session data goes here
  return sessionDatamyData;
}

exports.default = sessionExitPoint;

Agent Instructions can access session data through the sessionData variable. For example:

Code Block
You are helping ${identity.name} work with customer information.
The current customer number is ${sessionData.customerNumber}.

To access sessionData within a routine, use pjs.session. For example: pjs.session.sessionData.customerNumber.