Skip to main content

Install

npm install parmana
The package is named parmana on npm (typescript/package.json), not @parmana/sdk or similar — it publishes dist/index.js with dist/index.d.ts types, ESM-only ("type": "module"). It requires Node.js 20+.

Create a client

The SDK does not construct an HTTP transport for you implicitly — ParmanaClient’s constructor throws ConfigurationError if configuration.transport is missing, so you must construct HttpTransport yourself and pass it in:
import { ParmanaClient, HttpTransport } from "parmana";

const configuration = {
  endpoint: "http://localhost:3000",
  transport: undefined as any, // placeholder, see below
};

configuration.transport = new HttpTransport(configuration);

const client = new ParmanaClient(configuration);
ParmanaClient’s constructor (typescript/src/client/ParmanaClient.ts) validates exactly two things: configuration.endpoint and configuration.transport must both be truthy, or it throws ConfigurationError. Everything else on Configurationcredentials, timeout, retryPolicy, userAgent — is optional and unvalidated.

Configuration

Configuration (typescript/src/config/Configuration.ts):
FieldTypeDescription
endpointstringRequired. Base URL of the Parmana Runtime, e.g. https://runtime.example.com.
credentialsCredentialsOptional. See below.
timeoutnumberRequest timeout in milliseconds. Default 30000, enforced by HttpTransport via AbortController.
retryPolicyRetryPolicyOptional retry configuration (see below).
transportTransportRequired in practice — no default is constructed for you.
userAgentstringOptional SDK user agent string.

Credentials

import { AuthenticationScheme } from "parmana";

const credentials = {
  scheme: AuthenticationScheme.BEARER_TOKEN, // or AuthenticationScheme.API_KEY
  value: "your-token-or-key",
};
Configuring credentials currently has no effect. HttpTransport.send (typescript/src/transport/HttpTransport.ts) builds its request init.headers from only "Content-Type": "application/json" plus whatever request.headers the caller passes per-call — it never reads this.configuration.credentials at all. Setting credentials on Configuration does not add an Authorization header to outgoing requests. This is consistent with REST API → Authentication: the server doesn’t validate any auth today either, but even once it does, this client-side gap would need to be closed separately.

Retry policy

import { RetryStrategy } from "parmana";

const retryPolicy = {
  enabled: true,
  maxAttempts: 3,
  initialDelayMs: 1000,
  maxDelayMs: 30000,
  strategy: RetryStrategy.EXPONENTIAL,
};
RetryPolicy is a plain data shape (typescript/src/config/RetryPolicy.ts) with no retry logic behind it in this snapshot — HttpTransport.send makes exactly one fetch call per send() and never reads configuration.retryPolicy. Setting it currently documents intent only.

ParmanaClient

The client class this configuration constructs.

Errors

What actually gets thrown when a request fails.

Authentication

The server-side half of this same gap.

APIs

The sub-APIs ParmanaClient composes.