The `screenshotone-api-sdk` is the official client library for the ScreenshotOne.com API, enabling developers to programmatically generate and download screenshots of any website. It provides a fluent API for configuring various screenshot options, such as delay, ad blocking, and more, directly mirroring the latest API specifications. The current stable version is 1.1.21. The package appears to have an active release cadence, with continuous integration indicated by its build badge and consistent updates to synchronize with the underlying ScreenshotOne API. Key differentiators include its tight integration with the ScreenshotOne service, offering specific error handling for API-level issues, and providing both URL generation and direct screenshot download functionalities. It is designed for both JavaScript and TypeScript environments, shipping with its own type definitions.
npm install screenshotone-api-sdkVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the ScreenshotOne client, configure screenshot options using the fluent API, generate a signed URL, and then download the resulting screenshot to a local file. It also includes error handling for both API-specific and generic errors.
Store `SCREENSHOTONE_ACCESS_KEY` and `SCREENSHOTONE_SECRET_KEY` in environment variables. Access them via `process.env.VARIABLE_NAME` in Node.js or a build-time substitution for client-side applications.
Always wrap `await client.take(options)` in a `try...catch` block. Utilize `if (error instanceof APIError)` to differentiate between API-specific errors (with status codes, error codes, and documentation URLs) and other runtime errors.
Before upgrading to a new major SDK version, consult the package's changelog or GitHub releases page for any breaking changes related to API options, client methods, or error structures. Test thoroughly in a development environment.
For ES Modules, use `import { Client } from 'screenshotone-api-sdk';`. If forced to use CommonJS, ensure you're accessing the named export correctly: `const { Client } = require('screenshotone-api-sdk');`Double-check your `accessKey` and `secretKey` values. Ensure they are correctly copied from your ScreenshotOne.com dashboard and are being passed to the `Client` constructor.
Verify that your `secretKey` is correct and has not been truncated or altered. Ensure no extra characters or whitespace are included. Regenerate your secret key on the ScreenshotOne.com dashboard if issues persist.
No dependency data recorded yet.