Releases: walterra/node-html2img-render-server
v1.1.1
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:
- Update your package:
npm update node-html2img-render-server@1.1.1 - No configuration changes are required
For Docker users:
docker pull walterra/node-html2img-render-server:1.1.1v1.1.0
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 telemetryDocker 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-rendererCode 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:
- Update your package:
npm update node-html2img-render-server@1.1.0 - Add OpenTelemetry configuration to your environment variables
- Restart the service
For Docker users:
docker pull walterra/node-html2img-render-server:1.1.0Compatibility
- Node.js v18+
- Compatible with OpenTelemetry-compliant observability platforms
- Can be used with or without telemetry features
v1.0.1
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_PATHenvironment 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.1Documentation
See the README.md and EXAMPLES.md files for complete documentation.
License
MIT
v1.0.0
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-serverBasic 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