# Internal Package

## Purpose

Centralized location for internal utilities, environment configuration, and select integrations used across the Codebuff monorepo (`web`, `cli`, and `sdk`).

## Structure

- `env.ts`: Environment variable validation using @t3-oss/env-nextjs
- `utils/auth.ts`: Admin authentication utilities and auth token validation
- `loops/`: Email service integration for transactional emails

## Environment Variables

All environment variables are defined and validated in `env.ts`:

- Server variables: API keys, database URLs, service credentials
- Client variables: Public configuration values
- Loaded from `.env.local` (manually created or synced from Infisical)

## Current Integrations

### Loops Email Service

- **Purpose**: Transactional emails (invitations, basic messages)
- **Functions**: `sendOrganizationInvitationEmail`, `sendBasicEmail`, `sendSignupEventToLoops`
- **Environment**: Requires `LOOPS_API_KEY`
