Getting started
Installation
Add a Halyard SDK to your app, install the CLI for local development and deploys, and check that everything can reach the API.
On this page
Install an SDK
Official SDKs are available for four languages. They share one design: a Halyard client for the REST API and a Worker that runs your task handlers. All are versioned with the API, so SDK 3.x talks to API v3.
npm install @halyard/nodepip install halyardgo get halyard.example/go/halyard@v3gem install halyardPin the major version so a future v4 never arrives as a surprise:
{ "dependencies": { "@halyard/node": "^3.4.2" }}# requirements.txthalyard>=3.4,<4require halyard.example/go/halyard v3.3.1# Gemfilegem "halyard", "~> 3.2"Install the CLI
The halyard command line tool runs workers locally against the sandbox, applies your halyard.yaml on deploy and tails jobs live. It is a single binary with no runtime dependencies.
brew install halyard-labs/tap/halyardcurl -fsSL https://get.halyard.example/cli | shnpm install --global @halyard/cliThen sign in once. The CLI stores a test key for the project you pick:
halyard login› Opening https://app.halyard.example/cli/authorize?code=QKVM-7TXR› Waiting for confirmation in the browser…✓ Signed in as maya@northwind-labs.example✓ Project my-app · test key saved to ~/.halyard/credentialsEveryday commands
| Command | What it does |
|---|---|
| halyard login | Opens the browser, signs you in and stores a test key in ~/.halyard/credentials. |
| halyard dev | Runs your worker locally, reloads on file changes and streams jobs from the sandbox. |
| halyard deploy | Validates halyard.yaml and applies queue and schedule changes to the current environment. |
| halyard jobs tail | Follows job transitions live. Filter with --queue, --task or --status. |
# Run the worker in src/worker.ts, reload on changehalyard dev # Apply halyard.yaml to the live environmenthalyard deploy --env live # Follow failures on the emails queuehalyard jobs tail --queue emails --status failedEnvironment variables
The SDKs and the CLI read configuration from the environment, so the same code runs locally, in CI and in production. Arguments you pass in code always win over variables.
| Variable | Required | Example | Description |
|---|---|---|---|
| HALYARD_KEY | Yes | hy_test_… | Secret API key. The SDKs and the CLI read it when no key is passed explicitly. |
| HALYARD_API_BASE | No | https://api.halyard.example/v3 | Override the API host, for example to point at a local proxy. |
| HALYARD_QUEUES | No | emails,media | Comma-separated queues a worker listens on. Defaults to every queue in halyard.yaml. |
| HALYARD_CONCURRENCY | No | 10 | Jobs a single worker process runs at once. Default 5. |
| HALYARD_LOG_LEVEL | No | info | One of debug, info, warn, error. Default info. |
| HALYARD_SIGNING_SECRET | No | whsec_… | Endpoint secret used to verify webhook signatures. |
Project layout
A typical project keeps one halyard.yaml at the root, a worker entry point and one file per task. The CLI looks for halyard.yaml in the current directory and its parents.
# halyard.yamlversion: 3project: my-app queues: emails: concurrency: 20 rate_limit: 50/s media: concurrency: 8 timeout: 10m worker: entry: src/worker.ts concurrency: 5Requirements
| Runtime | Supported versions | Latest package |
|---|---|---|
| Node.js | 20.11 or later | @halyard/node 3.4.2 |
| Python | 3.10 or later | halyard 3.4.0 |
| Go | 1.22 or later | halyard.example/go/halyard 3.3.1 |
| Ruby | 3.2 or later | halyard 3.2.5 |
| Halyard CLI | macOS 13+, Linux (x64, arm64), Windows 11 | halyard 3.4.1 |
Workers need outbound HTTPS to api.halyard.example on port 443. No inbound ports are needed: workers pull jobs, Halyard never connects to them.
Verify the install
Run halyard doctor to check the CLI, your key and network access in one go:
halyard doctor✓ CLI 3.4.1 (latest)✓ HALYARD_KEY found · test mode · scopes: all✓ api.halyard.example reachable · 38 ms✓ halyard.yaml valid · 2 queues, 0 schedules! Node.js SDK 3.3.0 installed, 3.4.2 availableOr from code, retrieve the account the key belongs to:
import { Halyard } from "@halyard/node"; const halyard = new Halyard(process.env.HALYARD_KEY);const me = await halyard.account.retrieve(); console.log(me.environment, me.project); // test my-appimport osfrom halyard import Halyard halyard = Halyard(os.environ["HALYARD_KEY"])me = halyard.account.retrieve() print(me.environment, me.project) # test my-appclient := halyard.New(os.Getenv("HALYARD_KEY"))me, err := client.Account.Retrieve(ctx)if err != nil { log.Fatal(err)}fmt.Println(me.Environment, me.Project) // test my-apphalyard = Halyard::Client.new(ENV.fetch("HALYARD_KEY"))me = halyard.account.retrieve puts me.environment, me.project # test my-app401 Unauthorized when verifying
HALYARD_KEY to check it starts with hy_test_ or hy_live_, and that your shell loaded .env.local.Requests time out behind a corporate proxy
HTTPS_PROXY. If your proxy inspects TLS, point NODE_EXTRA_CA_CERTS (Node) or SSL_CERT_FILE (Python, Ruby, Go) at your company's CA bundle.