Skip to main content

ScreenshotOne Plugin

The ScreenshotOne plugin captures website screenshots using the ScreenshotOne API. It generates preview images for work items automatically during the generation pipeline, with support for signed URLs, ad blocking, and configurable viewport settings.

Source: packages/plugins/screenshotone/src/screenshotone.plugin.ts

Overview

PropertyValue
Plugin IDscreenshotone
Categoryscreenshot
Capabilitiesscreenshot
Version1.0.0
Configuration Modehybrid
Auto-enableNo
Built-inNo
System PluginNo
Dependenciesscreenshotone-api-sdk

The plugin implements IPlugin and IScreenshotPlugin. It uses the official screenshotone-api-sdk package to build capture requests and download the resulting images.

Architecture

Signed URLs

When both an access key and a secret key are configured, the plugin generates signed URLs. Signed URLs include an HMAC signature that prevents tampering and unauthorized use of your API credentials. Without a secret key, unsigned URLs are generated instead.

Configuration

Settings Schema

SettingTypeRequiredDefaultScopeDescription
accessKeystringYes--userScreenshotOne access key (secret)
secretKeystringNo--userSecret key for signed URLs (secret)
viewportWidthnumberNo1280--Viewport width in pixels (320--3840)
viewportHeightnumberNo800--Viewport height in pixels (200--2160)
formatstringNo"png"--Image format: png, jpg, jpeg, or webp
fullPagebooleanNofalse--Capture the full scrollable page
deviceScaleFactornumberNo1--Device scale factor (0.5--3, 2 = retina)
blockAdsbooleanNotrue--Block ads during capture
blockTrackersbooleanNotrue--Block trackers during capture

Environment Variables

VariableDescription
PLUGIN_SCREENSHOTONE_ACCESS_KEYAccess key fallback
PLUGIN_SCREENSHOTONE_SECRET_KEYSecret key fallback
PLUGIN_SCREENSHOTONE_VIEWPORT_WIDTHViewport width fallback
PLUGIN_SCREENSHOTONE_VIEWPORT_HEIGHTViewport height fallback
PLUGIN_SCREENSHOTONE_FORMATImage format fallback

Settings Resolution

API keys are resolved through the standard 4-level hierarchy:

  1. Work settings (highest priority)
  2. User settings
  3. Admin settings
  4. Environment variables (lowest priority)

Features

Screenshot Capture

async capture(options: ScreenshotOptions): Promise<ScreenshotResult>

Downloads a screenshot from the ScreenshotOne API. The result contains the image as a Buffer, a base64-encoded string, and a reference URL. Per-call options override plugin-level defaults.

URL Generation

async getScreenshotUrl(options: ScreenshotOptions): Promise<string | null>

Generates a screenshot URL without actually downloading the image. Useful when you need a hotlinkable image URL rather than the binary data.

Credential Validation

async validateCredentials(): Promise<ScreenshotValidationResult>

Verifies that the configured API credentials are valid by generating a test URL and checking that it points to api.screenshotone.com.

Ad and Tracker Blocking

Both ad blocking and tracker blocking are enabled by default. This ensures that captured screenshots are clean and free of distracting elements.

Per-request cookie banner blocking is available via the blockCookieBanners option in ScreenshotOptions. This removes cookie consent popups from the captured image.

Render Delay

The delay option (in milliseconds) waits before capturing, giving the page time to finish loading dynamic content. The plugin converts milliseconds to seconds for the ScreenshotOne API.

Selector Waiting

The waitForSelector option tells the API to wait until a specific CSS selector is present on the page before capturing.

Caching

When cache is enabled in the capture options, ScreenshotOne caches the result for the specified cacheTtl (time to live). Subsequent requests for the same URL return the cached image.

Supported Formats

  • png -- lossless, best for UI screenshots
  • jpg / jpeg -- lossy, smaller file size
  • webp -- modern format with excellent compression

Maximum Dimensions

The maximum viewport is 3840 x 2160 pixels (4K UHD).

Usage in Pipelines

During work generation, the screenshot facade delegates capture requests to ScreenshotOne for items with source URLs. The resulting images become item preview thumbnails.

Comparison with Urlbox

FeatureScreenshotOneUrlbox
SDKscreenshotone-api-sdkurlbox
Signed URLsYes (with secret key)Yes (with API secret)
Default viewport1280 x 8001280 x 1024
Device scale factor0.5--3 (configurable)Boolean retina (2x)
Image quality controlNo (format-dependent)Yes (1--100 slider)
Ad blockingYesYes
Tracker blockingYesNo
Cookie banner blockingPer-requestDefault enabled
Server-side cachingYes (with TTL)No
Supported formatsPNG, JPG, JPEG, WebPPNG, JPG, JPEG, WebP
Max dimensions3840 x 21603840 x 2160

ScreenshotOne offers granular device scale factor control (0.5--3), tracker blocking, and built-in caching. Urlbox provides a quality slider for lossy formats and cookie banner blocking enabled by default.

API Reference

Class: ScreenshotOnePlugin

class ScreenshotOnePlugin implements IPlugin, IScreenshotPlugin {
readonly id: 'screenshotone';
readonly category: 'screenshot';

capture(options: ScreenshotOptions): Promise<ScreenshotResult>;
getScreenshotUrl(options: ScreenshotOptions): Promise<string | null>;
validateCredentials(): Promise<ScreenshotValidationResult>;
getSupportedFormats(): readonly ScreenshotFormat[];
getMaxDimensions(): { width: number; height: number };
}

ScreenshotResult Fields

FieldDescription
successWhether capture succeeded
imageBufferRaw image data as a Buffer
imageBase64Base64-encoded image string
imageUrlReference URL for the screenshot
widthViewport width used
heightViewport height used
fileSizeImage file size in bytes
errorError message (on failure)

Getting Started

  1. Sign up at screenshotone.com
  2. Copy your access key and optional secret key (for signed URLs)
  3. Enable the ScreenshotOne plugin on the Plugins page
  4. Enter your credentials in the plugin settings
  5. Select ScreenshotOne as the screenshot provider for your work

Troubleshooting

IssueCauseSolution
"Access key not configured"Missing API credentialsSet the access key in plugin settings or via environment variable
Blank screenshotsPage loads dynamic contentUse the delay option or waitForSelector
Low-resolution imagesDefault scale factor is 1Increase deviceScaleFactor to 2 for retina output
Ads appearing in screenshotsblockAds disabledEnsure blockAds is set to true
Invalid credentialsWrong access key or secret keyVerify credentials at screenshotone.com dashboard