@compass/variables

This package provides functionalities to interact with the automation context in Compass. It allows you to retrieve and set variables within the context.

Usage

import variables from "@compass/variables";

API Reference

variables.get(key: string, scope?: string)

Retrieve a variable from the automation context.

  • key (required, string): The key of the variable to retrieve.

  • scope (optional, string): The scope of the variable to retrieve.

Returns the value of the variable. Returns null if the variable does not exist.

variables.set(key: string, value: any, scope?: string)

Set a variable in the automation context.

  • key (required, string): The key of the variable to set.

  • value (required, any): The value of the variable to set.

  • scope (optional, string): The scope of the variable to set.

Returns the value of the variable.

Examples

To retrieve a variable from the automation context:

To set a variable in the automation context:

Last updated