Skip to main content
Nectr uses environment variables for all configuration. Copy .env.example to .env and configure the required variables to get started.

Required Variables

These variables must be set for Nectr to start and review PRs.

AI Configuration

string
required
Your Anthropic API key for Claude Sonnet 4.5.Get your API key from console.anthropic.com
string
default:"claude-sonnet-4-5-20250929"
The Claude model to use for PR reviews.

Database

string
required
PostgreSQL connection string with asyncpg driver.Recommended: Use Supabase free tier.Navigate to: Dashboard → Connect → Connection Pooling → Session Mode (port 5432)
Use postgresql+asyncpg:// (not postgresql://) as Nectr requires async database support.

GitHub OAuth

string
required
GitHub OAuth App client ID.Create an OAuth App at: github.com/settings/developers → New OAuth App
string
required
GitHub OAuth App client secret.
Keep this secret secure. Never commit it to version control.
string
required
GitHub Personal Access Token (Classic) with repo scope.Used to post PR review comments on behalf of your account.Create at: github.com/settings/tokens → Generate new token (classic)Required scope: repo (Full control of private repositories)

Authentication

string
required
Secret key for JWT signing and token encryption.Generate a secure random key:
Changing this key will invalidate all existing user sessions and require users to re-authenticate.
string
default:"HS256"
JWT signing algorithm.
integer
default:"1440"
JWT token expiration time in minutes (default: 24 hours).

URLs

string
required
Public URL where your backend API is hosted.This URL is used for:
  • GitHub webhook callback endpoints
  • OAuth redirect URIs
string
required
Public URL where your frontend is hosted.Used for redirects after authentication.

Neo4j Knowledge Graph

string
required
Neo4j connection URI.Enables file-expert maps and related-PR context in every review.Get a free instance at: neo4j.com/cloud/platform/aura-graph-database
string
default:"neo4j"
Neo4j username.
string
required
Neo4j password.

Mem0 Memory Layer

string
required
Mem0 API key for semantic memory storage.Enables per-project patterns and per-developer learned habits.Get your API key at: mem0.ai

Optional Variables

These variables enable optional features. Leave blank to disable.

MCP Integrations

Pull live context (issues, errors, messages) into every review. Each integration is independent — set only the ones you use.
string
Linear MCP server base URL.
string
Linear personal API key.Get your API key from: Linear → Settings → API → Personal API keys
string
Sentry MCP server base URL.
string
Sentry auth token with project read permissions.Create at: Sentry → Settings → Auth Tokens
string
Slack MCP server base URL for fetching relevant channel messages.

Slack Bot (Direct Notifications)

string
Slack Bot User OAuth Token for direct notifications.This is separate from the MCP Slack integration above.
string
Slack app signing secret for verifying webhook requests.

Webhook Security

string
Global fallback webhook secret.Per-repo secrets are stored in the database automatically when you connect a repo. This global secret is only used as a fallback if no per-repo secret is found.
In production (APP_ENV=production), webhook signature verification is enforced. Without a valid secret, webhooks will be rejected with a 403 error.

Feature Flags

boolean
default:"false"
Enable parallel review mode with 3 specialized agents.
  • false (default): Single agentic review loop (faster, less token usage)
  • true: 3 specialized agents run in parallel (security / performance / style)
When enabled, Nectr runs three specialized agents concurrently:
  1. Security Agent - Focuses on vulnerabilities, authentication, data validation
  2. Performance Agent - Analyzes efficiency, database queries, caching
  3. Style Agent - Reviews code style, patterns, and maintainability
A synthesis agent then combines all three reviews into a final cohesive review.Trade-offs:
  • ✅ More thorough, specialized analysis
  • ✅ Parallel execution can be faster for large PRs
  • ❌ Higher token usage (4x Claude API calls)
  • ❌ Slightly higher cost per review

App Settings

Safe to leave as-is for local development.
string
default:"Nectr"
Application name.
string
default:"development"
Application environment.
  • development - Development mode (CORS relaxed, debug enabled)
  • production - Production mode (CORS strict, webhook signature verification enforced)
boolean
default:"true"
Enable debug mode.
string
default:"DEBUG"
Logging level.Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
string
default:"0.0.0.0"
Server host binding.
integer
default:"8000"
Server port.

Example Configuration


Next Steps

OAuth Setup

Configure GitHub OAuth App for user authentication

Webhooks

Learn how webhooks are configured and verified