> For the complete documentation index, see [llms.txt](https://docs.apica.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apica.io/flow/vault/variables.md).

# Variables

What are Variables?

Variables are the most straightforward form of configuration storage in Vault. They are general-purpose **key-value pairs**. Think of them like secure environment variables or general secrets storage.

* **Key:** A unique name you use to identify the variable (e.g., `STRIPE_API_KEY`, `DB_CONNECTION_STRING`).
* **Value:** The actual secret or configuration data associated with the key (e.g., `sk_live_...`, `postgres://user:pass@host:port/db`).

#### When to Use Variables?

Use Variables for storing individual pieces of sensitive information or configuration settings, such as:

* API keys for third-party services
* Database passwords or connection strings
* Secret keys used for signing (if not managed elsewhere)
* Simple configuration flags

Variables are ideal when you need direct access to a specific, distinct value identified by its name, including within code rules where supported.

#### Using Variables

You can retrieve the value of a variable stored in Vault using the `ascent.variables.get()` function. You need to know the unique name (ID) of the variable you want to access.

**1. Retrieve Variable Value**

Call `ascent.variables.get()` with the name of the variable.

```javascript
// Get the value of the variable named 'STRIPE_API_KEY' from Vault
const apiKey = ascent.variables.get("STRIPE_API_KEY");

// apiKey now holds the secret value stored in the Vault variable
console.log(apiKey); // Example output: "sk_live_..."
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apica.io/flow/vault/variables.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
