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

# Installation

> Install the Sentrial SDK in your project. Available for Python and TypeScript.

## One-Line Install

Run this from the root of your agent repo:

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/sentrialdev/Sentrial/main/scripts/install.sh | bash
```

This bootstraps the Sentrial CLI through npm, installs the right SDK package for
your project, and writes a safe example integration file.

### Options

```bash theme={null}
# Preview without changing files
curl -fsSL https://raw.githubusercontent.com/sentrialdev/Sentrial/main/scripts/install.sh | bash -s -- -- --dry-run

# Force Python setup when auto-detection is ambiguous
curl -fsSL https://raw.githubusercontent.com/sentrialdev/Sentrial/main/scripts/install.sh | bash -s -- -- --language python

# Use the beta npm tag
curl -fsSL https://raw.githubusercontent.com/sentrialdev/Sentrial/main/scripts/install.sh | bash -s -- --channel=beta
```

## Python

### Basic Installation

```bash theme={null}
pip install sentrial
```

### With LangChain Support

```bash theme={null}
pip install sentrial langchain-core

# Or install all optional dependencies
pip install sentrial[all]
```

### Requirements

* Python 3.9 or higher
* `requests` library (installed automatically)
* `langchain-core` (optional, for LangChain integration)

## TypeScript / Node.js

<CodeGroup>
  ```bash npm theme={null}
  npm install @sentrial/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @sentrial/sdk
  ```

  ```bash yarn theme={null}
  yarn add @sentrial/sdk
  ```
</CodeGroup>

### Requirements

* Node.js 18 or higher
* TypeScript 5.0+ (for TypeScript projects)

## Configuration

### Environment Variables (Recommended)

Set your API key as an environment variable for automatic configuration:

```bash theme={null}
# .env file
SENTRIAL_API_KEY=sentrial_live_xxxxxxxxxxxxx

# Optional: custom API URL (for self-hosted)
SENTRIAL_API_URL=https://api.sentrial.com
```

### Python Configuration

```python theme={null}
import sentrial

# Option 1: Use environment variables (automatic)
sentrial.configure()  # Reads SENTRIAL_API_KEY

# Option 2: Explicit configuration
sentrial.configure(
    api_key="sentrial_live_xxx",
    api_url="https://api.sentrial.com"  # Optional
)

# Option 3: Create client directly
from sentrial import SentrialClient
client = SentrialClient(api_key="sentrial_live_xxx")
```

### TypeScript Configuration

```typescript theme={null}
import { SentrialClient } from '@sentrial/sdk';

// Create client with API key
const client = new SentrialClient({
  apiKey: process.env.SENTRIAL_API_KEY,
  // Optional: custom API URL
  apiUrl: 'https://api.sentrial.com',
});
```

## Getting Your API Key

<Steps>
  <Step title="Sign in to Sentrial">
    Go to [sentrial.com](https://sentrial.com/login) and sign in.
  </Step>

  <Step title="Go to Settings">Navigate to Settings → API Keys in the sidebar.</Step>
  <Step title="Create API Key">Click "Create API Key", give it a name, and copy the key.</Step>
</Steps>

<Warning>
  **Keep your API key secure.** Never commit your API key to version control. Use environment
  variables or a secrets manager.
</Warning>

## Verify Installation

Run this quick test to verify everything is working:

```python theme={null}
import sentrial

# Configure
sentrial.configure(api_key="sentrial_live_xxx")

# Create a test session
interaction = sentrial.begin(
    user_id="test_user",
    event="test_event",
    input="Testing Sentrial installation"
)

# Finish it
interaction.finish(
    output="Installation verified!",
    success=True
)

print("Sentrial is working correctly!")
```

Check your Sentrial dashboard. You should see the test session appear within seconds.

## Next Steps

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Build your first tracked agent in 5 minutes.
  </Card>

  <Card title="Python SDK Reference" icon="python" href="/sdk/python">
    Complete API reference.
  </Card>
</CardGroup>
