Skip to content

Environment Variables

Varity Team Core Contributors Updated March 2026

Varity manages most credentials automatically. You only need to set environment variables for services you manage yourself.

.env.local
# Your Varity App ID (from developer portal)
NEXT_PUBLIC_VARITY_APP_ID=your-app-id

These variables are only needed for specific use cases:

VariableRequired ForDefault
NEXT_PUBLIC_VARITY_APP_IDApp identityDev default
VARITY_API_URLCustom API endpointhttps://varity.app
VARITY_API_KEYAPI authenticationAuto-provided
.env.local
# Varity SDK (optional — dev defaults work automatically)
NEXT_PUBLIC_VARITY_APP_ID=your-app-id

In development, the SDK uses shared credentials automatically. No other variables are needed.

Different frameworks require different prefixes for client-side variables:

FrameworkPrefixExample
Next.jsNEXT_PUBLIC_NEXT_PUBLIC_VARITY_APP_ID
ViteVITE_VITE_VARITY_APP_ID
Create React AppREACT_APP_REACT_APP_VARITY_APP_ID
  • Use .env.local for local development (git-ignored)
  • Store production secrets in your CI/CD platform
  • Rotate keys regularly
  • Commit .env files with real credentials
  • Use production keys in development
  • Share API keys in public repositories
  • Hardcode secrets in source code

Run the doctor command to verify your configuration:

Terminal window
varitykit doctor

This checks:

  • Credential availability (auto-provided or manually set)
  • Network connectivity
  • API key validity
  • Project structure
  1. Check file name is exactly .env or .env.local
  2. Restart your development server after changes
  3. Verify no syntax errors in the file
  4. Check framework-specific prefixes (NEXT_PUBLIC_, VITE_, etc.)

Run varitykit doctor to diagnose. Credentials are auto-provided — if they fail, check your network connection.

Advanced: Using Your Own Credentials

Varity manages these credentials automatically. Only use this if you need custom configuration.

Override managed credentials by setting these variables:

.env.local
# Authentication — get from https://dashboard.privy.io
NEXT_PUBLIC_PRIVY_APP_ID=your_privy_app_id
# Storage — get from https://thirdweb.com/dashboard
THIRDWEB_CLIENT_ID=your_thirdweb_client_id
THIRDWEB_SECRET_KEY=your_thirdweb_secret_key

Framework-specific variants:

Terminal window
# Next.js
NEXT_PUBLIC_THIRDWEB_CLIENT_ID=your_client_id
# Vite
VITE_THIRDWEB_CLIENT_ID=your_client_id
# Create React App
REACT_APP_THIRDWEB_CLIENT_ID=your_client_id

When these are set, the SDK and CLI use your credentials instead of the managed ones.