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
| Variable | Purpose | Required |
|---|---|---|
| NORTHSTAR_TOKEN | API bearer token | Yes |
| NORTHSTAR_BASE_URL | Override the API endpoint | No |
| NORTHSTAR_TIMEOUT | Request timeout in milliseconds | No |
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.