A service to create HTML screenshots for visual regression testing and image generation.
550
HTML to image rendering service using Playwright's headless browser.
A service for converting HTML to images with a REST API. It accepts direct HTML, CSS, and JavaScript input and returns screenshots for visual testing and image generation.
# Run with default settings
docker run -p 3000:3000 -e API_KEY=your-api-key walterra/node-html2img-render-server:latest
# Run with OpenTelemetry for observability
docker run -p 3000:3000 \
-e API_KEY=your-api-key \
-e OTEL_SERVICE_NAME=html-renderer \
-e OTEL_EXPORTER_OTLP_ENDPOINT=https://your-apm-endpoint:443 \
-e OTEL_EXPORTER_OTLP_HEADERS="Authorization=ApiKey your-api-key" \
walterra/node-html2img-render-server:latest
curl -X POST \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"html": "<div style=\"width:100px;height:100px;background-color:blue;\"></div>",
"viewport": {"width": 500, "height": 400},
"format": "png"
}' \
http://localhost:3000/render > screenshot.png
API_KEY: Authentication key for API accessPORT: Server port (default: 3000)NODE_ENV: Environment (development, production)RATE_LIMIT_MAX: Maximum requests per window (default: 60)RATE_LIMIT_WINDOW_MS: Rate limit window in ms (default: 60000)REQUEST_TIMEOUT_MS: Request timeout in ms (default: 30000)OTEL_SERVICE_NAME: Service name for telemetryOTEL_EXPORTER_OTLP_ENDPOINT: OpenTelemetry collector endpointOTEL_EXPORTER_OTLP_HEADERS: Headers for endpoint authenticationOTEL_SDK_DISABLED: Set to true to disable telemetry{
"html": "<div>Content to render</div>",
"css": "div { color: blue; }",
"javascript": "document.querySelector('div').textContent = 'Dynamic content';",
"viewport": {
"width": 1280,
"height": 720,
"deviceScaleFactor": 1
},
"waitForSelector": "#ready-element",
"clipSelector": "#capture-this",
"format": "png",
"quality": 90,
"responseFormat": "image"
}
latest: Latest stable release1.1.1: Enhanced OpenTelemetry instrumentation1.1.0: Initial OpenTelemetry support1.0.1: Maintenance release with Docker improvements1.0.0: Initial versionMIT
Content type
Image
Digest
sha256:1adfaba29…
Size
1.1 GB
Last updated
over 1 year ago
docker pull walterra/node-html2img-render-server