
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
screenshotly-js
Advanced tools
JavaScript client for the Screenshotly API - capture screenshots of any website programmatically
A JavaScript client library for the Screenshotly API that allows you to capture screenshots of any website programmatically.
npm install screenshotly-js
Or with yarn:
yarn add screenshotly-js
const { Screenshotly } = require('screenshotly-js');
// Initialize the client with your API key
const client = new Screenshotly('your-api-key-here');
// Capture a screenshot of a URL
async function captureScreenshot() {
const screenshot = await client.capture({
url: 'https://example.com',
width: 1280,
height: 800,
fullPage: true,
delay: 500
});
if (screenshot.success) {
console.log('Screenshot URL:', screenshot.data.imageUrl);
console.log('Remaining credits:', screenshot.remainingCredits);
} else {
console.error('Error:', screenshot.error);
}
}
captureScreenshot();
const { Screenshotly } = require('screenshotly-js');
const client = new Screenshotly('your-api-key-here');
async function captureBatchScreenshots() {
const result = await client.captureBatch({
urls: [
'https://example.com',
'https://google.com',
'https://github.com'
],
options: {
format: 'png',
width: 1280,
height: 800,
fullPage: true,
delay: 500
}
});
if (result.success) {
console.log('Screenshots:', result.data);
console.log('Remaining credits:', result.remainingCredits);
} else {
console.error('Error:', result.error);
}
}
captureBatchScreenshots();
const { Screenshotly } = require('screenshotly-js');
// You can also pass configuration options
const client = new Screenshotly({
apiKey: 'your-api-key-here',
baseUrl: 'https://api.screenshotly.dev',
timeout: 90000 // 90 seconds timeout for large pages
});
async function captureWithAdvancedOptions() {
const screenshot = await client.capture({
url: 'https://example.com',
format: 'png',
width: 1920,
height: 1080,
fullPage: true,
deviceScaleFactor: 2, // Retina-quality screenshot
isMobile: true,
hasTouch: true,
waitForSelector: '.content-loaded',
delay: 1000, // Wait 1 second before capturing
timeout: 45000 // 45 seconds timeout
});
console.log('Screenshot URL:', screenshot.data.imageUrl);
}
Screenshotly
Class// Simple format
new Screenshotly(apiKey)
// Advanced format
new Screenshotly(config)
apiKey
(string): Your Screenshotly API keyconfig.apiKey
(required): Your Screenshotly API keyconfig.baseUrl
(optional): Custom API base URL (default: 'https://api.screenshotly.dev')config.timeout
(optional): Request timeout in milliseconds (default: 60000)capture(options): Promise<object>
Captures a screenshot of the specified URL.
Options:
url
: URL to capture (required)name
: Optional name for the screenshotwidth
: Width of the viewport in pixels (default: 1920)height
: Height of the viewport in pixels (default: 1080)fullPage
: Whether to capture the full page or just the viewport (default: false)format
: Output format ('png', 'jpeg', 'webp') (default: 'png')deviceScaleFactor
: Device scale factor (default: 1)isMobile
: Whether to emulate a mobile device (default: false)hasTouch
: Whether the device has touch capabilities (default: false)isLandscape
: Whether to use landscape orientation (default: false)waitForSelector
: Optional selector to wait for before taking the screenshotdelay
: Delay in milliseconds before capturing the screenshot (default: 0)timeout
: Timeout in milliseconds (default: 30000)captureBatch(request): Promise<object>
Captures multiple screenshots in batch.
Request:
urls
: Array of URLs to take screenshots ofoptions
: Screenshot options (applied to all URLs)getScreenshots(page, limit): Promise<object>
Gets a list of your screenshots.
page
: Page number (default: 1)limit
: Number of items per page (default: 10)getScreenshot(id): Promise<object>
Gets a specific screenshot by ID.
deleteScreenshot(id): Promise<object>
Deletes a screenshot by ID.
MIT
FAQs
JavaScript client for the Screenshotly API - capture screenshots of any website programmatically
We found that screenshotly-js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.