{"id":20172598,"url":"https://github.com/screenshotone/jssdk","last_synced_at":"2025-04-10T02:54:50.544Z","repository":{"id":65552792,"uuid":"500525501","full_name":"screenshotone/jssdk","owner":"screenshotone","description":"A JavaScript (and TypeScript) SDK for the ScreenshotOne.com API to take screenshots of any URL","archived":false,"fork":false,"pushed_at":"2025-03-19T14:25:06.000Z","size":214,"stargazers_count":15,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-19T15:31:39.519Z","etag":null,"topics":["javascript","javascript-library","javascript-package","node","nodejs","screenshot","screenshot-api","screenshot-as-a-service","screenshot-bot","screenshot-comparison","screenshot-comparison-tests","screenshot-generator","screenshot-library","screenshot-taker","screenshot-testing","screenshot-utility","screenshots","typescript","typescript-library","typescript-package"],"latest_commit_sha":null,"homepage":"https://screenshotone.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/screenshotone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-06T17:14:59.000Z","updated_at":"2025-03-19T14:25:09.000Z","dependencies_parsed_at":"2024-06-16T13:28:49.397Z","dependency_job_id":"480f0e67-de19-4179-8b6a-b1529bd1db43","html_url":"https://github.com/screenshotone/jssdk","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"e9ae03f51fb7de6691a1ff26a4add9bfb3c0428e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screenshotone%2Fjssdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screenshotone%2Fjssdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screenshotone%2Fjssdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/screenshotone%2Fjssdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/screenshotone","download_url":"https://codeload.github.com/screenshotone/jssdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248147402,"owners_count":21055540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","javascript-library","javascript-package","node","nodejs","screenshot","screenshot-api","screenshot-as-a-service","screenshot-bot","screenshot-comparison","screenshot-comparison-tests","screenshot-generator","screenshot-library","screenshot-taker","screenshot-testing","screenshot-utility","screenshots","typescript","typescript-library","typescript-package"],"created_at":"2024-11-14T01:31:29.947Z","updated_at":"2025-04-10T02:54:50.505Z","avatar_url":"https://github.com/screenshotone.png","language":"TypeScript","readme":"# jssdk\n\n[![Build](https://github.com/screenshotone/jssdk/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/screenshotone/jssdk/actions/workflows/build.yml)\n[![NPM package](https://img.shields.io/npm/v/screenshotone-api-sdk.svg?branch=main)](https://www.npmjs.com/package/screenshotone-api-sdk)\n\nAn official [Screenshot API](https://screenshotone.com/) client for JavaScript and TypeScript. \n\nIt takes minutes to start taking screenshots. Just [sign up](https://screenshotone.com/) to get access and secret keys, import the client, and you are ready to go. \n\nThe SDK client is synchronized with the latest [screenshot API options](https://screenshotone.com/docs/options/).\n\n## Installation\n\n```shell\nnpm install screenshotone-api-sdk --save\n```\n\n## Usage\n\nGenerate a screenshot URL without executing the request. Or download the screenshot. It is up to you: \n```javascript\nimport * as fs from 'fs';\nimport * as screenshotone from 'screenshotone-api-sdk';\n\n// create API client \nconst client = new screenshotone.Client(\"\u003caccess key\u003e\", \"\u003csecret key\u003e\");\n\n// set up options\nconst options = screenshotone.TakeOptions\n    .url(\"https://example.com\")\n    .delay(3)\n    .blockAds(true);    \n\n// generate URL \nconst url = client.generateTakeURL(options);\nconsole.log(url);\n// expected output: https://api.screenshotone.com/take?url=https%3A%2F%2Fexample.com\u0026delay=3\u0026block_ads=true\u0026access_key=%3Caccess+key%3E\u0026signature=7f3419ece2c53ed2c7923c7d5deef290d662c3643822bf69ec8259ce10b3ea61\n\n// download the screenshot and handle potential API errors\ntry {\n    const imageBlob = await client.take(options);\n\n    const buffer = Buffer.from(await imageBlob.arrayBuffer());\n    fs.writeFileSync(\"example.png\", buffer);\n} catch (error) {\n    if (error instanceof screenshotone.APIError) {\n        // An API error occurred with \n        // HTTP Status Code: error.httpStatusCode\n        // Error Code: error.errorCode\n        // Error Message: error.errorMessage\n        // Documentation URL: error.documentationUrl \n    } else {        \n        // An unexpected error occurred\n        console.error(\"An unexpected error occurred:\", error.message);\n    }\n}\n```\n\n## Build and publish (a manual for SDK developers)\n\nTo build and publish the SDK: \n\n1. Bump the version property in the `package.json` file. \n2. Run `npm run prepare`. \n3. Run `npm publish`.\n\n## License \n\n`screenshotone/jssdk` is released under [the MIT license](LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreenshotone%2Fjssdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscreenshotone%2Fjssdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreenshotone%2Fjssdk/lists"}