> ## Documentation Index
> Fetch the complete documentation index at: https://docs.manthan.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation

> Installing and configuring the Parmana TypeScript SDK

## Install

```bash theme={null}
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:

```ts theme={null}
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);
```

<Note>
  `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 `Configuration` — `credentials`, `timeout`, `retryPolicy`, `userAgent` — is optional and unvalidated.
</Note>

## Configuration

`Configuration` (`typescript/src/config/Configuration.ts`):

| Field         | Type          | Description                                                                                          |
| ------------- | ------------- | ---------------------------------------------------------------------------------------------------- |
| `endpoint`    | `string`      | Required. Base URL of the Parmana Runtime, e.g. `https://runtime.example.com`.                       |
| `credentials` | `Credentials` | Optional. See below.                                                                                 |
| `timeout`     | `number`      | Request timeout in milliseconds. Default `30000`, enforced by `HttpTransport` via `AbortController`. |
| `retryPolicy` | `RetryPolicy` | Optional retry configuration (see below).                                                            |
| `transport`   | `Transport`   | Required in practice — no default is constructed for you.                                            |
| `userAgent`   | `string`      | Optional SDK user agent string.                                                                      |

### Credentials

```ts theme={null}
import { AuthenticationScheme } from "parmana";

const credentials = {
  scheme: AuthenticationScheme.BEARER_TOKEN, // or AuthenticationScheme.API_KEY
  value: "your-token-or-key",
};
```

<Warning>
  **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](/docs/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.
</Warning>

### Retry policy

```ts theme={null}
import { RetryStrategy } from "parmana";

const retryPolicy = {
  enabled: true,
  maxAttempts: 3,
  initialDelayMs: 1000,
  maxDelayMs: 30000,
  strategy: RetryStrategy.EXPONENTIAL,
};
```

<Warning>
  `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.
</Warning>

## Related

<CardGroup cols={2}>
  <Card title="ParmanaClient" href="/docs/typescript-sdk/parmana-client">The client class this configuration constructs.</Card>
  <Card title="Errors" href="/docs/typescript-sdk/errors">What actually gets thrown when a request fails.</Card>
  <Card title="Authentication" href="/docs/api/authentication">The server-side half of this same gap.</Card>
  <Card title="APIs" href="/docs/typescript-sdk/apis">The sub-APIs `ParmanaClient` composes.</Card>
</CardGroup>
