Demo Modern
Getting StartedInstallation
Getting Started

Installation

Install and initialize the Northstar SDK.

Use the HTTP API directly or install an official SDK. The examples in this documentation use JavaScript, but the same resources are available in every client.

JavaScript

bash
npm install @northstar/sdk
Initialize the client with an environment variable:
ts
import { Northstar } from '@northstar/sdk';

const northstar = new Northstar({
  token: process.env.NORTHSTAR_TOKEN,
});

PHP

bash
composer require northstar/sdk
php
use Northstar\Client;

$northstar = new Client(
    token: $_ENV['NORTHSTAR_TOKEN'],
);

Requirements

ClientMinimum requirement
JavaScript SDKNode.js 20 or later
PHP SDKPHP 8.3 or later
Direct API accessTLS 1.2 or later

Verify the installation

List projects to confirm that your token and client are configured correctly:
ts
const projects = await northstar.projects.list();
console.log(projects.data);
Never commit API tokens to source control. Use your deployment platform's secret manager for production credentials.