# Configuration (/docs/sdks/configuration)
The SDK is built to run with no settings in code. Set a few environment variables, and every `Dock` and `Lynk` you create picks them up. Pass a constructor option when one instance needs something different.

## Environment variables [#environment-variables]

| Variable | Used by | Description |
| --- | --- | --- |
| `DOCKLEE_API_KEY` | `Dock`, `Lynk` | Your API key. Required. See [API keys](/docs/docklee/api-keys). |
| `DOCKLEE_MEMORY_SPACE_ID` | `Dock`, `Lynk` | The memory space to write to and recall from. |
| `DOCKLEE_ENGINE_ID` | `Lynk` | The engine to query and retrieve from. |
| `DOCKLEE_END_USER` | `Dock`, `Lynk` | A default end user. See [End users](/docs/docklee/end-users). |
| `DOCKLEE_CONTAINER` | `Dock` | `vector` or `okf`. See [Containers](/docs/docklee/containers). |
| `DOCKLEE_DIMENSION` | `Dock` | The vector dimension, as a positive whole number. |
| `DOCKLEE_URL` | `Dock`, `Lynk` | The API address. Leave it unset to use `https://api.docklee.com`. |

```bash
export DOCKLEE_API_KEY="your-api-key"
export DOCKLEE_MEMORY_SPACE_ID="your-memory-space-id"
export DOCKLEE_ENGINE_ID="your-engine-id"
```

`DOCKLEE_BASE_URL` is also read as the API address, after `DOCKLEE_URL`.

<Callout type="warn">
A `DOCKLEE_DIMENSION` that isn't a positive whole number raises an error as soon as `Dock` is created, so a typo never sends writes to the wrong dimension.
</Callout>

## Which value wins [#which-value-wins]

For every setting, the SDK uses the first of these that's set:

1. The option passed to one method call, such as `end_user` on `recall`.
2. The option passed to the constructor.
3. The environment variable.
4. The default.

## `Dock` options [#dock-options]

| Python | TypeScript | Default | Description |
| --- | --- | --- | --- |
| `api_key` | `apiKey` | `DOCKLEE_API_KEY` | Your API key. |
| `memory_space_id` | `memorySpaceId` | `DOCKLEE_MEMORY_SPACE_ID` | The memory space to write to. |
| `container` | `container` | `DOCKLEE_CONTAINER` | `vector` or `okf`. |
| `dimension` | `dimension` | `DOCKLEE_DIMENSION` | The vector dimension. |
| `end_user` | `endUser` | `DOCKLEE_END_USER` | The default end user. |
| `base_url` | `baseUrl` | `DOCKLEE_URL` | The API address. |
| `buffer_size` | `bufferSize` | `10` | Events that trigger a send. |
| `flush_interval` | `flushInterval` | `5000` ms in TypeScript | How often TypeScript sends the buffer. |
| `max_retries` | `maxRetries` | `3` | Retries per request. |
| `timeout` | `timeout` | 30 seconds | How long to wait for a response. |

## `Lynk` options [#lynk-options]

| Python | TypeScript | Default | Description |
| --- | --- | --- | --- |
| `api_key` | `apiKey` | `DOCKLEE_API_KEY` | Your API key. |
| `engine_id` | `engineId` | `DOCKLEE_ENGINE_ID` | The engine to read from. |
| `memory_space_id` | `memorySpaceId` | `DOCKLEE_MEMORY_SPACE_ID` | The memory space to recall from. |
| `end_user` | `endUser` | `DOCKLEE_END_USER` | The default end user. |
| `base_url` | `baseUrl` | `DOCKLEE_URL` | The API address. |
| `max_retries` | `maxRetries` | `3` | Retries per request. |
| `timeout` | `timeout` | 30 seconds | How long to wait for a response. |

<Callout type="info">
`timeout` is in seconds in Python and in milliseconds in TypeScript. Pass `timeout=60` in Python or `timeout: 60000` in TypeScript for a 60-second timeout.
</Callout>

## Pass options in code [#pass-options-in-code]

<CodeTabs items={['Python', 'TypeScript']}>
  <Tab value="Python">
    ```python
    import os
    from docklee import Dock, Lynk

    dock = Dock(
        api_key=os.environ["SUPPORT_BOT_DOCKLEE_KEY"],
        memory_space_id="your-memory-space-id",
        buffer_size=25,
        timeout=60,
    )
    lynk = Lynk(engine_id="your-engine-id", max_retries=5)
    ```
  </Tab>
  <Tab value="TypeScript">
    ```ts
    import { Dock, Lynk } from 'docklee';

    const dock = new Dock({
      apiKey: process.env.SUPPORT_BOT_DOCKLEE_KEY,
      memorySpaceId: 'your-memory-space-id',
      bufferSize: 25,
      timeout: 60000,
    });
    const lynk = new Lynk({ engineId: 'your-engine-id', maxRetries: 5 });
    ```
  </Tab>
</CodeTabs>

Every request carries a `User-Agent` of `docklee-python/2.0.0` or `docklee-js/2.0.0`.

## Next steps [#next-steps]

Your SDK is configured. See every method for your language next.

<Cards>
  <Card title="Python" href="/docs/sdks/python" description="Every Python class and method." />
  <Card title="TypeScript" href="/docs/sdks/typescript" description="Every TypeScript class and method." />
  <Card title="Errors and retries" href="/docs/sdks/errors-and-retries" description="What's retried, and what's raised." />
</Cards>
