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

# TypeScript SDK

> A thin client with no dependencies.

> [!NOTE]
>
> `constella-sdk` is not on npm yet. Until it is, call the [HTTP routes](/dev/docs/api-reference/introduction.md) (the client below is about 20 lines), or [email us](mailto:team@constella.app) for the package.

```typescript theme={"system"}
import { Constella } from "constella-sdk";

// Your own memory
const constella = new Constella({ key: process.env.CONSTELLA_API_KEY, client: "my-script" });
await constella.me.memory.add({ text: "We ship on Fridays.", id: "team:ship-day" });
const { sources } = await constella.me.memory.recall("when do we ship?");

// Your app's users
const app = new Constella({ key: process.env.CONSTELLA_APP_KEY });
await app.users("u_123").memory.add({ text: "Prefers short answers." });
```

## Without the SDK

```typescript theme={"system"}
const API = "https://api.constella.app/platform/v1";

export async function callTool(name: string, args: Record<string, unknown>, uid?: string) {
  const path = uid ? `/users/${encodeURIComponent(uid)}/tools/${name}` : `/me/tools/${name}`;
  const res = await fetch(API + path, {
    method: "POST",
    headers: {
      Authorization: `Bearer ${uid ? process.env.CONSTELLA_APP_KEY : process.env.CONSTELLA_API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({ arguments: args }),
  });
  const body = await res.json();
  if (!res.ok) throw new Error(`${body.detail?.code}: ${body.detail?.message}`);
  return body.result;
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.