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/sdkInitialize 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/sdkphp
use Northstar\Client;
$northstar = new Client(
token: $_ENV['NORTHSTAR_TOKEN'],
);Requirements
| Client | Minimum requirement |
|---|---|
| JavaScript SDK | Node.js 20 or later |
| PHP SDK | PHP 8.3 or later |
| Direct API access | TLS 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.
