Password Protection

Restrict access to your deployed sites with a shared password.

How It Works

When password protection is enabled, visitors must enter a password before they can view your site. After entering the correct password, a session cookie is set and they can browse freely for 7 days.

This is useful for:

Setup

Configure password protection from the dashboard:

  1. Navigate to your site’s Settings page
  2. Under Password Protection, choose a scope
  3. Enter a password (4–128 characters)
  4. Save

Protection Scopes

ScopeWhat’s Protected
noneNo protection (default)
productionOnly the live production deployment
previewOnly preview deployments (non-current)
allBoth production and preview deployments

Via API

# Enable password protection for production
curl -X PATCH -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"password": "my-secret", "scope": "production"}' \
  "https://api.zerodeploy.dev/sites/my-site/password"

# Disable password protection
curl -X PATCH -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"scope": "none"}' \
  "https://api.zerodeploy.dev/sites/my-site/password"

Visitor Experience

When a visitor accesses a protected site:

  1. They see a branded password prompt
  2. They enter the password
  3. If correct, a session cookie (__zd_access) is set for 7 days
  4. They can browse the site freely until the session expires

The password prompt page is styled to match ZeroDeploy branding with a clean, minimal design.

Security

Password Requirements

Changing the Password

When you update the password, all existing sessions remain valid until they expire (up to 7 days). To immediately invalidate all sessions, change the password twice — the session tokens are tied to the password hash.

Plan Limits

FeatureFreePro
Password protectionIncluded
Protection scopesAll scopes
Session duration7 days