Demo Modern
Getting StartedConfiguration
Getting Started

Configuration

Configure environments, retries, and request behavior.

The SDK works with sensible defaults, while allowing request behavior to be adjusted for your application.

Client options

ts
const northstar = new Northstar({
  token: process.env.NORTHSTAR_TOKEN,
  baseUrl: 'https://api.northstar.example/v1',
  timeout: 10_000,
  maxRetries: 2,
});

Environment variables

VariablePurposeRequired
NORTHSTAR_TOKENAPI bearer tokenYes
NORTHSTAR_BASE_URLOverride the API endpointNo
NORTHSTAR_TIMEOUTRequest timeout in millisecondsNo

Retries

The SDK retries connection failures, 429 Too Many Requests, and transient 5xx responses. Mutating requests include an idempotency key so a retry does not create duplicate resources.
ts
await northstar.projects.create(
  { name: 'Demo Store', region: 'eu-west' },
  { idempotencyKey: 'project-demo-store' },
);

Request identifiers

Every response includes an x-request-id header. Record this value in application logs; it is the fastest way to trace a failed request.