TheDocumentation Index
Fetch the complete documentation index at: https://docs.requestly.com/llms.txt
Use this file to discover all available pages before exploring further.
rq.vault object provides methods to access encrypted secrets stored in the Requestly Vault during script execution. Vault secrets are kept out of collections, exports, and cloud sync. Only {{vault:key}} references travel with your project, while the resolved values stay on the user’s machine.
rq.vault is only available in the Requestly desktop app. Vault features are disabled in the web-only mode.Methods
rq.vault.get(key)
Retrieves the value of a vault secret. Works for both local secrets and AWS Secrets Manager secrets that have been fetched into the vault.
Parameters:
key(string): The name of the vault secret to retrieve
Promise that resolves to the secret’s string value, or undefined if the key doesn’t exist.
Example:
rq.vault.set(key, value)
Creates or updates a local vault secret. The value is persisted to encrypted storage via the OS keychain.
Parameters:
key(string): The name of the vault secret to create or updatevalue(string): The value to store
Promise that resolves when the secret is persisted.
Example:
rq.vault.unset(key)
Removes a local vault secret.
Parameters:
key(string): The name of the vault secret to remove
Promise that resolves when the secret is removed.
Example:
rq.vault.has(key)
Checks whether a vault secret with the given key exists. Works for both local and AWS secrets.
Parameters:
key(string): The name of the vault secret to check
Promise that resolves to true if the secret exists, false otherwise.
Example:
Common Use Cases
Generate a JWT Without Exposing the Signing Key
Keep the signing key inside the vault and expose only the generated token to the request:{{auth-token}} in the Authorization header. The signing key never leaves the vault.
Cache a Short-Lived Token Locally
Fetch a token once, store it in the vault, and reuse it across subsequent requests until it expires:Guard Optional Secrets
Only apply a signing step when the signing key is configured:Clean Up Temporary Secrets
Remove a short-lived secret once it is no longer needed:Behavior Notes
- All methods are asynchronous. Always
awaitthem. Synchronous usage will return aPromise, not the value. - Values are strings. Non-string values passed to
set()should be stringified by the caller (e.g.,JSON.stringify(obj)). - AWS-linked secrets are read-only.
set()andunset()only operate on local secrets. Useget()/has()for AWS secrets. - JSON secrets from AWS auto-expand. For a secret named
dbCredentialsstoring{ "username": "admin" }, userq.vault.get("dbCredentials.username")to read the nested value. - Masked in console. Values returned from
rq.vault.get()are masked in the Requestly console output. They resolve correctly at request time, but never appear in plaintext in logs. - No cloud sync. Anything written with
rq.vault.set()stays on the current machine and is never included in collection exports or workspace sync.

