# Your Opik code here
```

**TypeScript usage with .env file:**

The TypeScript SDK automatically loads `.env` files, so no additional setup is required:

```typescript
import { Opik } from "opik";

// Configuration is automatically loaded from .env
const client = new Opik();
```

### Using Configuration Files

Both SDKs support configuration files for persistent settings.

#### Python SDK Configuration File

The Python SDK uses the [TOML](https://github.com/toml-lang/toml) format. The `configure` method creates this file automatically, but you can also create it manually:

<Tabs>
  <Tab value="Opik Cloud" title="Opik Cloud">
    ```toml
    [opik]
    url_override = https://www.comet.com/opik/api
    api_key = <API Key>
    workspace = <Workspace name>
    project_name = <Project Name>
    ```
  </Tab>

  <Tab value="Self-hosting" title="Self-hosting">
    ```toml
    [opik]
    url_override = http://localhost:5173/api
    workspace = default
    project_name = <Project Name>
    ```
  </Tab>
</Tabs>

#### TypeScript SDK Configuration File

The TypeScript SDK also supports the same `~/.opik.config` file format as the Python SDK. The configuration file uses INI format internally but shares the same structure:

<Tabs>
  <Tab value="Opik Cloud" title="Opik Cloud">
    ```ini
    [opik]
    url_override = https://www.comet.com/opik/api
    api_key = <API Key>
    workspace = <Workspace name>
    project_name = <Project Name>
    ```
  </Tab>

  <Tab value="Self-hosting" title="Self-hosting">
    ```ini
    [opik]
    url_override = http://localhost:5173/api
    workspace = default
    project_name = <Project Name>
    ```
  </Tab>
</Tabs>

<Tip>
  By default, both SDKs look for the configuration file in your home directory (`~/.opik.config`). You can specify a
  different location by setting the `OPIK_CONFIG_PATH` environment variable.
</Tip>

## Debug Mode and Logging

Both SDKs provide debug capabilities for troubleshooting integration issues.

### Python SDK Logging

The Python SDK provides two separate logging channels that can be configured independently:

* **Console Logging**: Controls log output to the console (stdout/stderr)
* **File Logging**: Controls log output to a file

Both channels support the following log levels: `DEBUG`, `INFO` (default), `WARNING`, `ERROR`, `CRITICAL`

#### Controlling Console Logging

To control the console log level, set the `OPIK_CONSOLE_LOGGING_LEVEL` environment variable *before* importing `opik`:

```shell