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

# Environment Variables

> Configure your Orca Memory deployment

## Backend (Convex)

These go in `packages/backend/.env.local`:

### Core

| Variable             | Description               | Example                      |
| -------------------- | ------------------------- | ---------------------------- |
| `SITE_URL`           | Your dashboard URL        | `https://app.yourdomain.com` |
| `FRONTEND_URL`       | Same as SITE\_URL         | `https://app.yourdomain.com` |
| `COOKIE_DOMAIN`      | Domain for cookies        | `.yourdomain.com`            |
| `BETTER_AUTH_SECRET` | Secret for signing tokens | Random 32+ char string       |

### Embeddings Service

| Variable                   | Description            | Example                 |
| -------------------------- | ---------------------- | ----------------------- |
| `EMBEDDING_URL`            | Embeddings service URL | `http://localhost:8008` |
| `EMBEDDING_MODEL`          | Model to use           | `intfloat/e5-base-v2`   |
| `MEMORY_VECTOR_SCAN_LIMIT` | Max vectors to scan    | `2000`                  |

### Authentication (OAuth)

```bash theme={null}
# GitHub OAuth
GITHUB_CLIENT_ID=your-github-oauth-id
GITHUB_CLIENT_SECRET=your-github-oauth-secret
```

### OTP via Twilio (Optional)

```bash theme={null}
TWILIO_ACCOUNT_SID=your-twilio-sid
TWILIO_AUTH_TOKEN=your-twilio-token
TWILIO_VERIFY_SERVICE_SID=your-verify-service
```

### Email via Resend (Optional)

```bash theme={null}
RESEND_SEND_API_KEY=your-resend-api-key
RESEND_CONTACTS_API_KEY=your-contacts-key
RESEND_AUDIENCE_ID=your-audience-id
```

### Billing via Polar (Optional)

```bash theme={null}
POLAR_ORGANIZATION_TOKEN=your-polar-token
POLAR_WEBHOOK_SECRET=your-webhook-secret
POLAR_PRODUCT_SURFACE_ID=prod_xxx
POLAR_PRODUCT_TIDE_ID=prod_xxx
POLAR_PRODUCT_ABYSS_ID=prod_xxx
```

## Frontend (Dashboard)

These go in `apps/dashboard/.env`:

```bash theme={null}
# Convex
VITE_CONVEX_URL=https://your-deployment.convex.cloud
VITE_CONVEX_SITE_URL=https://your-deployment.convex.site
VITE_INTERNAL_SITE_URL=http://localhost:3002

# Analytics (Bklit) - Optional
VITE_BKLIT_PROJECT_ID=your-project-id
VITE_BKLIT_API_KEY=your-api-key
VITE_BKLIT_API_HOST=https://analytics.nebaura.studio
VITE_BKLIT_ENVIRONMENT=production
VITE_BKLIT_DEBUG=false
```

## Embeddings Service

These go in `apps/embeddings/.env`:

```bash theme={null}
EMBEDDING_MODEL=intfloat/e5-base-v2
EMBEDDING_MAX_BATCH=32
```

### Model Options

| Model                 | Size  | Quality | Speed  |
| --------------------- | ----- | ------- | ------ |
| `intfloat/e5-base-v2` | 438MB | Best    | Medium |
| `all-MiniLM-L6-v2`    | 80MB  | Good    | Fast   |
| `all-mpnet-base-v2`   | 420MB | Better  | Medium |

## Example Complete Setup

**packages/backend/.env.local:**

```bash theme={null}
# Core
SITE_URL=https://app.yourdomain.com
FRONTEND_URL=https://app.yourdomain.com
COOKIE_DOMAIN=.yourdomain.com
BETTER_AUTH_SECRET=your-super-secret-key-at-least-32-chars

# Embeddings
EMBEDDING_URL=http://localhost:8008
EMBEDDING_MODEL=intfloat/e5-base-v2
MEMORY_VECTOR_SCAN_LIMIT=2000

# OAuth
GITHUB_CLIENT_ID=xxxxx
GITHUB_CLIENT_SECRET=xxxxx

# Email (optional)
RESEND_SEND_API_KEY=re_xxxxx
```

**apps/dashboard/.env:**

```bash theme={null}
VITE_CONVEX_URL=https://your-project.convex.cloud
VITE_CONVEX_SITE_URL=https://your-project.convex.site
```

## Security Notes

<Warning>
  Never commit `.env` files to version control. Add `.env` to your `.gitignore`.
</Warning>

* Use strong, random values for secrets
* Rotate keys periodically
* Use different values for development and production
* Consider using a secrets manager in production
