BeavBeav

Workflow overview

Environment variables and scripts

Store third-party service credentials and use them on demand inside a single task or a reusable JavaScript script.

When a process has to run again and again — reading data from a third-party API, shaping it into a fixed format, or syncing results into another service — let Beav save it as a reusable script. Scripts run on Beav's built-in runtime, so nothing else has to be installed on your computer.

Save the environment variables you need first

Go to Settings → Environment & keys and add the URLs, tokens, or API keys the third-party service needs.

  • Choose Secret for tokens, keys, and passwords; they are stored in the system keychain.
  • Non-sensitive settings, such as an API URL or a fixed project ID, can be stored as plain values.
  • Environment variables are shared across the whole Beav app; they are not duplicated per workspace.

Saving an environment variable does not mean every script can read it. When you create a script, you must declare exactly which variables it needs, and the script only ever receives the variables in that declaration.

Use them in a single task

Environment variables are not only for scripts. When a task needs a third-party service, just say what you want done and which variable names to use in the chat; there is no need to paste an API key or token into the conversation.

Use the environment variables ACME_API_KEY and ACME_API_URL to
look up today's orders and summarize them by product. Do not display the key.

An Agent can confirm which variable names are set, but it cannot see the plain values or the contents of a Secret. Only when it actually runs the task you asked for does the system hand the explicitly referenced variables to that call. Environment variables are never offered automatically to every task, script, or workspace; name the variable each time you use one.

Create a script

In the chat, describe the repeatable process to automate, its inputs, and the expected output, and ask directly for a reusable script. For example:

Create a reusable script: pull today's orders from the Acme API,
summarize quantities and revenue by product, then output a daily report.
It needs the environment variables ACME_API_KEY and ACME_API_URL.
Use it only in the current workspace.

You can also ask for it to be reusable across every workspace:

Create a reusable script that works in all workspaces.
It takes one keyword, calls a third-party search API, and returns the top ten results with links.
Use the environment variable SEARCH_API_KEY.

By default, a script is saved to the current workspace when one exists; with no workspace, it is saved as a personal reusable script. If a script with the same name already exists, Beav updates the version in the same scope — it never overwrites a built-in skill or a same-named script in another scope.

Run and reuse

Later, just name the script in the chat and pass the arguments. For example:

Run “Today's Order Digest” for the date 2026-08-05.

or:

Use “Industry Search” to look up AI video tools and give me links I can open directly.

The Agent enables that script first, then passes the arguments and returns the result. Script output is meant to feed straight into briefs, drafts, the knowledge base, or later media tasks. Never put an API key, token, or other secret into the chat, and never ask a script to print them.

No development environment needed

Scripts Beav creates are written in JavaScript and executed by the app's built-in runtime, so your computer does not need Node.js or any other programming environment. They are built for fixed inputs, HTTP/HTTPS API calls, and handing results back to the conversation.

If you want to read or adjust the script code, the surface it can use is small and explicit:

  • process.env: reads the environment variables declared at creation time, for example process.env.SEARCH_API_KEY.
  • process.argv: reads the text arguments passed at runtime.
  • beav.fetch({ url, method, headers, body }): makes an HTTP or HTTPS request and reads the status, response headers, and body.
  • print(...): returns the result to the conversation.

Scripts cannot use require, import, the file system, subprocesses, or command-line tools installed on your computer, and top-level await is not available either. These boundaries keep scripts running reliably on machines with no development setup, and stop them from reaching past the environment variables and network requests they declared.

Update and debug

When API fields, parameters, or the authentication method change, ask the Agent to update the same-named script and state the required environment variables again. On an authentication failure, check the variable names and values in Settings → Environment & keys first, then confirm the names declared by the script match exactly.

Deleting an environment variable leaves every script that depends on it unable to run. Update or remove those scripts before deleting the variable.