Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt

Use this file to discover all available pages before exploring further.

There are two ways to expose values to your tasks: the env field in your App Configuration and Secrets. Both show up on the env property of your task context at runtime. Only the values for the current environment are injected — when running locally, only env.local values are used; when deployed, only env.cloud values are used. They are never merged together. If a secret has the same name as an env variable, the secret value takes precedence.

Example

Declare environment variables and secrets in your compose.yaml:
# compose.yaml
name: "my-app"
env:
  local:
    MY_VAR: "foo"
    ANOTHER_VAR: "bar"
  cloud:
    MY_VAR: "boo"
    ANOTHER_VAR: "baz"
secrets:
  - MY_SECRET
tasks:
 - name: "task1"
   path: "./task1.ts"
Secrets are listed by name only — set their values locally in a .env file or in the cloud with goldsky compose secrets set. See Secrets for details. Reference them in your tasks via the env property of the task context:
import { TaskContext } from "compose";

export async function main({ env }: TaskContext) {
  console.log(env.MY_VAR);
  console.log(env.ANOTHER_VAR);
  console.log(env.MY_SECRET);
}

callTask

Trigger tasks from other tasks, creating composable workflows.

Using Packages

You can use any sandbox compatible typescript packages with any package manager.