Configure app variables and secrets app-variables

IMPORTANT
Adobe LLM Apps is currently in Beta.
Features, workflows, and UI shown here do not necessarily represent the final state of the product. To join the Beta, send an email to llm-apps-beta@adobe.com.

Use variables and secrets to configure your app without hardcoding values in its action handlers. For example, configure the product catalog API URL to use a test service in Stage and the live service in Production without changing the handler code.

Variables hold non-sensitive settings. Secrets are intended for sensitive values such as API keys and access tokens.

IMPORTANT
The UI currently supports only variables. Secret support is planned for a future release. Until then, DO NOT store passwords, API keys, access tokens, or other sensitive information in variables: the settings table displays variable values and lets users copy them.

In this guide: Learn how to add an app variable and read it in an action handler. Deploy the app and check that the handler uses the expected value.

Before you begin before-you-begin

You need:

  • Access to your app’s handler repository to update handlers that need to read variables.
  • @adobe/llm-apps-runtime 1.1.0 or later in that repository. Check the version before using the helper below.

To check the version, run the following command in your handler repository:

npm ls @adobe/llm-apps-runtime

If the version is earlier than 1.1.0, upgrade it, then commit and push package.json and package-lock.json:

npm install @adobe/llm-apps-runtime@latest

Manage variables manage-variables

Each environment, Stage or Production, has its own variables. Check Workspace before adding, updating, or deleting a variable. Changes take effect the next time you deploy the app to that environment.

Add a variable add-variable-to-app

This example uses the non-sensitive variable GREETING_PREFIX with the value Good day to override the handler’s default greeting of Hello. Adding a variable does not change an action automatically: the handler must read the variable.

Step 1: Add a variable in the UI add-a-variable

  1. Open your app and select Settings in the left navigation.

  2. Open the Variables & Secrets tab.

  3. In Workspace, select Stage or Production.

  4. Select Add.

    Variables & Secrets — empty Stage workspace with the Add button

  5. In the dialog, enter:

    • Name: GREETING_PREFIX.
    • Type: leave Variable selected.
    • Value: Good day.

    Add Variable or Secret — GREETINGPREFIX set to Good day

  6. To save the variable, select Add.

The variable appears in the table with its Name, Type, Value, and Last updated date. To copy the value, use the adjacent copy control.

Variables & Secrets — GREETINGPREFIX saved in the Stage workspace

IMPORTANT
Saving adds the variable to the selected environment’s configuration. It does not update the deployed app until you deploy again.

Step 2: Read the variable in your handler use-a-variable

In your handler repository, open actions/<action-name>/index.js. Ensure that the handler accepts a second argument, extra, and read the variable with getVariable:

const { getVariable } = require('@adobe/llm-apps-runtime');

module.exports = async ({ name = 'there' } = {}, extra) => {
  const prefix = getVariable(extra, 'GREETING_PREFIX') || 'Hello';

  return {
    content: [{ type: 'text', text: `${prefix}, ${name}!` }]
  };
};

With the value Good day, a call with name set to Ada returns Good day, Ada! instead of the default Hello, Ada!. If you later change the value to Howdy, the greeting changes after you redeploy, without another handler edit.

The name in your code must match the name in the UI exactly. If the variable is not set, getVariable returns undefined. Choose a suitable default, as in the example, or return a clear error if the action requires the setting.

NOTE
Variables are available only in your app’s action handlers; they are not automatically available to widgets.

When your handler changes are ready, commit and push them to your app’s handler repository. The next deployment uses the latest pushed code. To learn more about editing handlers, see Customize a generated handler.

Step 3: Deploy and test deploy-and-verify

  1. Deploy your app to the same environment you selected in Workspace.
  2. Call the action from a supported LLM platform with name set to Ada. See Test the ChatGPT plugin or Test the Claude connector.
  3. Confirm that the response is Good day, Ada!. The response verifies that the handler reads your configured variable and overrides its default greeting.

To configure the other environment, select that environment in Workspace, repeat the setup with the appropriate value, then deploy and test the app there.

NOTE
Stage and Production have independent configurations. Changes in one environment do not affect the other. Use the same name in both environments if necessary, and choose the appropriate value for each.
TIP
To test locally before deploying, see Local handler development and testing and pass the variables to the local server:
node server/local.js --param 'LLMA_VARIABLE_NAMES=["GREETING_PREFIX"]' --param GREETING_PREFIX=Howdy

Update a variable update-or-delete

  1. Select the edit control on the variable’s row.

  2. Review the variable’s Current value and enter a New value.

    Update GREETINGPREFIX — change the value from Good day to Howdy

  3. Select Update.

  4. Deploy the app again to the same environment and verify the changed behavior.

Updating a variable changes only its value. You cannot rename variables. To use a different name, delete the existing variable, add a new variable, and update your handler to read the new name.

Delete a variable delete-a-variable

  1. Check whether any action still requires the variable. If necessary, update and push the handler first.

  2. Select the delete control on the variable’s row. To delete several entries, select their checkboxes and choose Delete.

  3. Review the names in the confirmation dialog, then select Delete.

    Delete GREETINGPREFIX — confirm the permanent deletion

  4. Deploy the app again to the same environment.

IMPORTANT
You CANNOT undo deletion. Check that you selected the correct variable. The deployed app keeps its existing configuration until the next deployment. After that deployment, handlers no longer receive the deleted variable, so an action that requires the variable may fail.

Rules and limits good-to-know

Item
Rule
Name
Up to 64 characters: uppercase letters, digits, and underscores, not starting with a digit. Must be unique per app and environment, and must match the handler.
Reserved names
Names starting with LLMA_, and MCP_SERVER_URL.
Value
Required, up to 500 characters. The platform removes leading and trailing spaces.
Limit
50 variables per app and environment.
Visibility
Variable values are visible and copyable. Planned secret support keeps saved values hidden.
Changes
Take effect on the next deployment to the selected environment.

Troubleshooting verify-configuration

What you see
What to do
Add is disabled and the page shows Workspace limit reached
Delete variables you no longer need.
Use uppercase letters, digits, and underscores only
Rename, for example API_BASE_URL.
This name is reserved by the platform
Choose a name that does not start with LLMA_ and is not MCP_SERVER_URL.
A variable with this name already exists
Update the existing variable instead.
This variable was just modified elsewhere
Refresh the page and try again.
Could not load variables
Reload the page. If the error persists, check that you have access to the app.
The action does not use the new value
Check that you deployed after saving the variable and tested the same environment. Confirm that you pushed the handler change and that the variable name matches exactly. Last updated shows when you saved the value, not when you deployed the app.
getVariable is not a function
Your app uses a runtime older than 1.1.0. Upgrade it as described in Before you begin, then deploy.
The action fails after you deleted a variable
Add the variable back, or update the handler so it no longer needs it, then deploy.

What’s next whats-next

recommendation-more-help
llm-apps-help-main-toc