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

# JavaScript

> Install the Darwin JavaScript client and make your first agent request.

## Install

```bash theme={null}
npm install @darwinso/sdk
```

## Create a client

```typescript theme={null}
import { DarwinClient } from '@darwinso/sdk';

const darwin = new DarwinClient({
  token: process.env.DARWIN_API_KEY!,
});
```

## Send an intent-routed message

```typescript theme={null}
const turn = await darwin.conversations.createMessage({
  content: 'Show me the requests that need my attention.',
});
```

Messages are account scoped and intent routed. You can name an accessible personal or business agent naturally; an agent ID is not required for every turn.

## Use an agent-scoped resource

```typescript theme={null}
const { agents } = await darwin.agents.listAgents();
const goals = await darwin.goals.listGoals({ agentId: agents[0].id });
```

Fern generates the SDK from Darwin's reviewed public OpenAPI contract. Continue to the [TypeScript SDK specification](/sdks/typescript-specification) for client behavior and the [cheat sheets](/sdks/cheat-sheets) for common operations.

<Warning>
  Keep API keys on your server. Do not include them in browser code, mobile bundles, or model-visible prompts.
</Warning>
