Skip to content

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/node

Pin the major version so a future v4 never arrives as a surprise:

{  "dependencies": {    "@halyard/node": "^3.4.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/halyard

Then sign in once. The CLI stores a test key for the project you pick:

halyard login
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/credentials

Everyday commands

CommandWhat it does
halyard loginOpens the browser, signs you in and stores a test key in ~/.halyard/credentials.
halyard devRuns your worker locally, reloads on file changes and streams jobs from the sandbox.
halyard deployValidates halyard.yaml and applies queue and schedule changes to the current environment.
halyard jobs tailFollows job transitions live. Filter with --queue, --task or --status.
Examples
# 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 failed

Environment 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.

VariableRequiredExampleDescription
HALYARD_KEYYeshy_test_…Secret API key. The SDKs and the CLI read it when no key is passed explicitly.
HALYARD_API_BASENohttps://api.halyard.example/v3Override the API host, for example to point at a local proxy.
HALYARD_QUEUESNoemails,mediaComma-separated queues a worker listens on. Defaults to every queue in halyard.yaml.
HALYARD_CONCURRENCYNo10Jobs a single worker process runs at once. Default 5.
HALYARD_LOG_LEVELNoinfoOne of debug, info, warn, error. Default info.
HALYARD_SIGNING_SECRETNowhsec_…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.

my-app/
halyard.yaml— queues, schedules and worker settings
.env.local— HALYARD_KEY, never committed
package.json
src/
worker.ts— starts the worker process
tasks/
send-welcome-email.ts
resize-image.ts
nightly-report.ts
halyard.yaml
# halyard.yamlversion: 3project: my-app queues:  emails:    concurrency: 20    rate_limit: 50/s  media:    concurrency: 8    timeout: 10m worker:  entry: src/worker.ts  concurrency: 5

Requirements

RuntimeSupported versionsLatest package
Node.js20.11 or later@halyard/node 3.4.2
Python3.10 or laterhalyard 3.4.0
Go1.22 or laterhalyard.example/go/halyard 3.3.1
Ruby3.2 or laterhalyard 3.2.5
Halyard CLImacOS 13+, Linux (x64, arm64), Windows 11halyard 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
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 available

Or 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-app
401 Unauthorized when verifying
The key is missing, mistyped or revoked. Print the first characters of 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
The SDKs honour 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.

Suggested