Parchment Docs
Development

Environment

Environment variables and configuration for Parchment.

All configuration is done via environment variables. Copy .env.example to .env and fill in the values.

Database

VariableDescriptionDefault
POSTGRES_DBDatabase name
POSTGRES_USERDatabase user
POSTGRES_PASSWORDDatabase password

Server

VariableDescriptionDefault
SERVER_ORIGINPublic URL of the API serverhttp://localhost:5000
CLIENT_ORIGINPublic URL of the frontendhttp://localhost:5173

The CLIENT_ORIGIN variable controls which origins the API allows requests from. In production, set it to your exact frontend domain.

Security keys

These two keys must be independent random 32-byte values. Generate them separately:

openssl rand -base64 32   # → SERVER_IDENTITY_PRIVATE_KEY
openssl rand -base64 32   # → PARCHMENT_INTEGRATION_ENCRYPTION_KEY
VariableDescription
SERVER_IDENTITY_PRIVATE_KEYEd25519 seed for federation server identity. Persist across restarts — rotation breaks TOFU pinning on peers.
PARCHMENT_INTEGRATION_ENCRYPTION_KEYAES-256 master key for encrypting third-party API keys stored in the integrations table.

Both are required — the server refuses to start without them.

Email (optional)

Used for sign-in verification codes and user invitations. Email is optional — if not configured, OTP codes are logged to the server console and invitation emails are skipped. See Email Setup for provider-specific instructions.

VariableDescriptionDefault
SMTP_HOSTSMTP server hostname
SMTP_PORTSMTP server port465
SMTP_SECUREUse TLStrue
SMTP_USERSMTP username
SMTP_PASSSMTP password or API key
SMTP_FROMSender addressParchment <noreply@parchment.app>
APP_TESTER_EMAILEmail used in automated tests

Documentation Site

VariableDescriptionDefault
NEXT_PUBLIC_CLIENT_ORIGINApp URL shown in the docs headerhttp://localhost:5173

Billing (optional)

Billing is powered by Polar and gated by a signed license token. When these variables are not set, all features are unlocked for every user. See Billing & Subscriptions for full setup instructions.

VariableDescriptionRequired
PARCHMENT_LICENSESigned license token (Ed25519)Production only
POLAR_ACCESS_TOKENPolar API access tokenNo
POLAR_WEBHOOK_SECRETPolar webhook signing secretNo
POLAR_ORGANIZATION_IDYour Polar organization IDNo
POLAR_PREMIUM_PRODUCT_IDPolar product ID for the Premium tierNo
POLAR_SANDBOXSet to true to use Polar's sandbox environmentNo
REGISTRATION_MODEinvite (default) or openNo

In development (NODE_ENV=development), the license check is skipped — only the Polar credentials are needed.

Integrations

Third-party integrations can be enabled in the app under Settings → Integrations. Each may require its own API key at the instance level.

Observability

The server supports OpenTelemetry for tracing and log export:

VariableDescription
OTEL_EXPORTER_OTLP_ENDPOINTOTLP endpoint for traces and logs
OTEL_SERVICE_NAMEService name in traces