# TypeScript

Use the TypeScript client and an explicit capability header to call your dedicated Mind.

Source: https://docs.minds.sh/docs/developers/typescript



The TypeScript package contains HTTP clients for engine services and a separate control-plane export. Its local package manifest supports Node.js 18 or later and produces ESM, CommonJS, and TypeScript declarations.

## Install [#install]

The package name is `@minds-sdk/typescript`. If it is available in your configured registry:

```bash
npm install @minds-sdk/typescript
```

For a source checkout, install dependencies and build inside `minds-ts-sdk`, then install that local package from your application. The registry publication was not verified by this source audit; keep package resolution separate from runtime connection testing.

## Make a scoped request [#make-a-scoped-request]

The public `HttpClient.request()` accepts additional headers. This lets you use the required capability header while keeping the SDK's HTTP status handling:

```typescript
import { HttpClient } from '@minds-sdk/typescript';

const baseUrl = process.env.MINDS_INSTANCE_URL;
const capability = process.env.MINDS_CAPABILITY;
if (!baseUrl || !capability) throw new Error('Set the Mind endpoint and capability');

const http = new HttpClient({ baseUrl, timeoutMs: 30_000 });
const output = await http.request<{
  is_error: boolean;
  result?: { memories?: unknown[] };
}>('POST', '/v1/mcp/tools/call', {
  name: 'recall',
  arguments: { query: 'launch review', limit: 5 },
}, { 'x-akasha-capability': capability });

if (output.is_error) throw new Error('Recall failed');
console.log(output.result?.memories ?? []);
```

The generic type describes what your code expects; it is not runtime validation. Validate results at a trust boundary if your application depends on specific fields.

## High-level client structure [#high-level-client-structure]

`AkashaClient` exposes `core`, `kv`, `graph`, `vector`, `analytics`, `ml`, `memory`, `router`, `snn`, `ns`, `continual`, `mhn`, and `brain`. `connect(uri, options)` and `resolveAkashaBase()` support a direct endpoint or an `akasha://` shorthand; a short slug resolves under `minds.sh`.

`SDKConfig` accepts `baseUrl`, optional `token`, `timeoutMs&#x60;, and namespace headers. &#x2A;*`token` is sent as Bearer authentication.** It does not automatically become `x-akasha-capability`. High-level service methods do not all expose extra-header injection.

The `@minds-sdk/typescript/control-plane` export is for management operations, which use a separate base URL and authentication contract.

## Compatibility and errors [#compatibility-and-errors]

`AkashaError` includes the HTTP status code and parsed details for an unsuccessful response. A successful HTTP request can still carry a tool-level failure, as shown above.

The current `brain.remember`, `brain.recall`, and `brain.forget` methods target per-tool HTTP paths that differ from the daemon's tool-call route. Hybrid retrieval and episodic insertion also have known contract differences. Use [Compatibility](/docs/developers/compatibility) before replacing the explicit request with a convenience method.

Router operations use the optional Node gRPC dependencies and have their own connection setup. Do not assume that browser-compatible HTTP operations imply browser support for the gRPC client.

The [complete TypeScript reference](/docs/developers/reference/typescript) includes every discovered exported type, constructor, and public method, grouped by source file.
