Skip to content

Releases: walterra/node-html2img-render-server

v1.1.1

12 May 23:03

Choose a tag to compare

Release Date: May 13, 2025

Overview

Version 1.1.1 of node-html2img-render-server enhances the OpenTelemetry implementation with more detailed instrumentation and improved reliability, particularly in environments where telemetry is not configured.

Improvements

Enhanced OpenTelemetry Integration

  • Refined middleware instrumentation for more precise tracing
  • Added detailed spans for key rendering operations
  • Improved error handling in instrumentation code
  • Docker containers now only load OpenTelemetry when explicitly configured

Testing and Quality

  • Added unit tests for OpenTelemetry instrumentation
  • Improved code quality with better linting and formatting

Upgrade Instructions

This is a patch release with no breaking changes. To upgrade:

  1. Update your package: npm update node-html2img-render-server@1.1.1
  2. No configuration changes are required

For Docker users:

docker pull walterra/node-html2img-render-server:1.1.1

v1.1.0

09 May 22:25

Choose a tag to compare

Overview

Version 1.1.0 of node-html2img-render-server adds OpenTelemetry integration for observability in production environments. This release enables monitoring, debugging, and optimizing HTML rendering services.

Key Features

OpenTelemetry Integration

The service now includes OpenTelemetry support via @elastic/opentelemetry-node.

Environment Variable Configuration

Configure telemetry using OpenTelemetry environment variables:

OTEL_SERVICE_NAME=node-html2img-render-server
OTEL_EXPORTER_OTLP_ENDPOINT=https://your-otlp-endpoint:443
OTEL_EXPORTER_OTLP_HEADERS="Authorization=ApiKey your_api_key_here"

# Optional control
OTEL_SDK_DISABLED=false  # Set to 'true' to disable telemetry

Docker Support

The Docker container includes OpenTelemetry support:

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" \
  html-renderer

Code Quality Improvements

  • Added ESLint and Prettier for code style
  • Improved error handling
  • Added validation for configuration parameters

Upgrade Instructions

This is a non-breaking update. To upgrade:

  1. Update your package: npm update node-html2img-render-server@1.1.0
  2. Add OpenTelemetry configuration to your environment variables
  3. Restart the service

For Docker users:

docker pull walterra/node-html2img-render-server:1.1.0

Compatibility

  • Node.js v18+
  • Compatible with OpenTelemetry-compliant observability platforms
  • Can be used with or without telemetry features

v1.0.1

06 May 14:47

Choose a tag to compare

This is a maintenance release of node-html2img-render-server with Docker container improvements.

Changes Since v1.0.0

Docker Container Improvements

  • Fixed Browser Installation: Fixed Playwright browser installation in Docker containers
  • Environment Variables: Added explicit PLAYWRIGHT_BROWSERS_PATH environment variable
  • Permissions Fix: Improved cache directory permissions for the renderuser
  • Browser Launch Resilience: Enhanced browser launch logic with better error handling
  • Removed Public Screenshots Directory: Eliminated unnecessary public directory creation

Other Improvements

  • Repository Information: Added GitHub repository URL to package.json
  • Documentation: Updated Docker build and run instructions

Breaking Changes

None

Requirements

  • Node.js ≥ 18

How to Upgrade

# Update your package
npm install node-html2img-render-server@1.0.1

# Or with Docker
docker pull walterra/node-html2img-render-server:1.0.1

Documentation

See the README.md and EXAMPLES.md files for complete documentation.

License

MIT

v1.0.0

05 May 23:08

Choose a tag to compare

This is the first release of node-html2img-render-server, a service for converting HTML to images with Playwright.

What is it?

A lightweight server that accepts HTML input and returns screenshot images, designed specifically for visual regression testing. It ensures pixel-perfect consistency across environments - solving the common problem of rendering differences between machines.

Key Features

  • Direct HTML Rendering: Submit raw HTML/CSS/JS without needing public URLs
  • Consistent Output: Identical rendering across all environments
  • Asset Support: Inject custom fonts and images directly
  • Flexible Options: Configure viewport size, target elements, and wait conditions
  • Multiple Formats: PNG and JPEG output with quality settings
  • Security: API key authentication and rate limiting
  • Response Formats: Direct binary images or JSON with base64 and metadata
  • Easy Deployment: Run with npx, Docker, or as a local installation

Quick Start

# Run without installation
npx node-html2img-render-server

# Or install globally
npm install -g node-html2img-render-server
node-html2img-server

Basic Example

const response = await fetch('http://localhost:3000/render', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-Key': 'your-api-key'
  },
  body: JSON.stringify({
    html: '<div style="background: blue; width: 100px; height: 100px;"></div>',
    viewport: { width: 200, height: 200 }
  })
});

// Response is a PNG image
const imageBuffer = await response.arrayBuffer();

Breaking Changes

None (first stable release)

Requirements

  • Node.js ≥ 18

Documentation

See the README.md and EXAMPLES.md files for complete documentation.

License

MIT