GitHub

Zen Server (Team Hosting)

The optional @zen-reports/zen-server backend: remote history mode, PostgreSQL + object storage, multi-shard ingestion, runId idempotency, and licensing.

@zen-reports/zen-server is an optional backend service that centralizes Zen Reports for Playwright run history for teams. It is maintained in a separate repository (zen-reports/zen-server) under the restrictive Functional Source License (FSL-1.1-MIT).

For single-developer and standard CI setups, Zen Reports for Playwright’s default embedded SQLite mode requires zero external infrastructure and is fully MIT-licensed. Reach for Zen Server when history must be shared across a team, persisted centrally, or aggregated from many shards.


When You Need It

  • Distributed teams: every engineer and CI runner records into one shared history instead of isolated local history.db files.
  • Enterprise multi-shard pipelines: sharded runs (see Sharded Runs) ingest into a single store that de-duplicates by runId.
  • Central media storage: screenshots, videos, and traces are uploaded to cloud object storage and served from one place.

Architecture

RemoteHistoryStore replaces the local SQLite store inside the reporter:

  • Requests presigned upload URLs from the server.
  • PUTs attachment binaries (screenshots, videos, trace files, stdout/stderr) directly to cloud object storage — S3, GCS, or Azure.
  • Streams lightweight run metadata to a PostgreSQL-backed ingestion API.
@zen-reports/zen-reporter-playwright
└── RemoteHistoryStore
├── presigned URL request ──► Zen Server (PostgreSQL ingestion API)
├── PUT attachment binary ──► S3 / GCS / Azure object storage
└── run metadata stream ──► Zen Server

Configuration

Enable remote mode through the history object in your Playwright config (see the full reference in the Configuration guide):

export default defineConfig({
reporter: [
[
'@zen-reports/zen-reporter-playwright',
{
history: {
mode: 'remote',
serverUrl: process.env.ZEN_SERVER_URL || 'https://zen-reporter.internal',
apiKey: process.env.ZEN_REPORTER_API_KEY, // optional; tenant authentication
projectId: 'frontend-e2e', // optional; explicit project/repo identifier
runId: process.env.GITHUB_RUN_ID, // optional; idempotency key
fallbackToLocal: true, // default true — keeps a local SQLite copy when the server is unreachable
timeoutMs: 5000, // default 5000 ms per ingestion request
},
},
],
],
});

Environment Variables

Variable Purpose
ZEN_SERVER_URL Base URL of the Zen Server instance.
ZEN_REPORTER_API_KEY Tenant API key for authentication (referenced from config, never hardcoded).
ZEN_REPORTER_PROJECT_ID Fallback project identifier when projectId is not set in config.
ZEN_REPORTER_RUN_ID Portable idempotency key for any CI (Jenkins, Bitbucket, GitLab, CircleCI).
GITHUB_RUN_ID Set automatically by GitHub Actions; used as the runId fallback.

runId Resolution (Idempotency)

The server de-duplicates runs by runId — re-running the same CI job must not create a second history entry. When runId is not set explicitly, values are tried in order:

  1. runId from the config
  2. process.env.ZEN_REPORTER_RUN_ID — portable across any CI system
  3. process.env.GITHUB_RUN_ID — set automatically by GitHub Actions
  4. a deterministic ID derived from the run’s start time, run name, and shard index

projectId

The config value takes precedence; otherwise process.env.ZEN_REPORTER_PROJECT_ID is used. It identifies the project/repo whose runs are being recorded.


Resilience: fallbackToLocal

With fallbackToLocal: true (the default), an unreachable server never fails your test run: the reporter keeps a local SQLite copy and surfaces a system-scoped notice in the Notification Center. Per-request latency is bounded by timeoutMs.


Multi-Shard Ingestion

Combined with Playwright sharding, remote mode gives each shard a deterministic identity: the fallback runId includes the shard index, while explicitly set runIds (e.g. the GitHub Actions run ID) keep all shards of one CI job mapped to a single de-duplicated entry. See Sharded Runs for the blob/merge pattern.


Licensing Note

Zen Server is FSL-1.1-MIT licensed: the source is available and MIT-licensed functionality remains usable, but the license restricts offering the service commercially to third parties. Everything the reporter itself ships (@zen-reports/zen-reporter-playwright, @zen-reports/zen-cli) stays MIT.

Server documentation lives in the repository: zen-reports/zen-server.