{"id":47779709,"url":"https://github.com/mblode/headless-screenshot-worker","last_synced_at":"2026-04-03T13:00:32.417Z","repository":{"id":337322450,"uuid":"1152498171","full_name":"mblode/headless-screenshot-worker","owner":"mblode","description":null,"archived":false,"fork":false,"pushed_at":"2026-02-08T22:50:56.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-09T04:21:51.891Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mblode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"mblode"}},"created_at":"2026-02-08T00:42:47.000Z","updated_at":"2026-02-08T22:51:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mblode/headless-screenshot-worker","commit_stats":null,"previous_names":["mblode/headless-screenshot-worker"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/mblode/headless-screenshot-worker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fheadless-screenshot-worker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fheadless-screenshot-worker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fheadless-screenshot-worker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fheadless-screenshot-worker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mblode","download_url":"https://codeload.github.com/mblode/headless-screenshot-worker/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mblode%2Fheadless-screenshot-worker/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31352315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T08:03:20.796Z","status":"ssl_error","status_checked_at":"2026-04-03T08:00:37.834Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2026-04-03T13:00:15.488Z","updated_at":"2026-04-03T13:00:32.411Z","avatar_url":"https://github.com/mblode.png","language":"TypeScript","funding_links":["https://github.com/sponsors/mblode"],"categories":[],"sub_categories":[],"readme":"# Screenshot Worker\n\nA Cloudflare Worker that generates, caches, and serves website screenshots using [Headless Render API](https://headless-render-api.com) and [Cloudflare Images](https://developers.cloudflare.com/images/).\n\n## How it works\n\n1. Request comes in (e.g., `GET /about`)\n2. The worker checks Cloudflare Images for a cached screenshot\n3. On cache miss, it takes a screenshot via Headless Render API. Pass `?invalidate=true` to force a fresh screenshot.\n4. The screenshot is uploaded to Cloudflare Images for future requests\n5. The image is returned as JPEG\n\n## Prerequisites\n\n- Node.js 22+\n- Cloudflare account with [Images](https://developers.cloudflare.com/images/) enabled\n- [Headless Render API](https://headless-render-api.com) account\n\n## Setup\n\n```bash\nnpm install\n```\n\nEdit `wrangler.toml` with your values, then set your secrets:\n\n```bash\nwrangler secret put CLOUDFLARE_API_TOKEN\nwrangler secret put HEADLESS_API_TOKEN\n```\n\nFor local development, create a `.dev.vars` file:\n\n```\nCLOUDFLARE_API_TOKEN=your_cloudflare_api_token\nHEADLESS_API_TOKEN=your_headless_api_token\n```\n\n## Configuration\n\n### Environment variables (`wrangler.toml`)\n\n| Variable | Description |\n|---|---|\n| `SITE_BASE_URL` | Base URL of the site to screenshot |\n| `IMAGE_URL` | Cloudflare Images delivery URL |\n| `CLOUDFLARE_API_URL` | Cloudflare Images API endpoint |\n| `HEADLESS_API_URL` | Headless Render API endpoint |\n\n### Secrets\n\n| Secret | Description |\n|---|---|\n| `CLOUDFLARE_API_TOKEN` | Cloudflare API token with Images:Edit permission |\n| `HEADLESS_API_TOKEN` | Headless Render API token |\n\n## API\n\n### `GET /:path`\n\nReturns a JPEG screenshot of `SITE_BASE_URL/:path`.\n\n| Parameter | Default | Description |\n|---|---|---|\n| `invalidate` | `false` | Force regenerate the screenshot |\n| `vw` | `1280` | Viewport width for screenshot capture |\n| `vh` | `800` | Viewport height for screenshot capture |\n| `width` | `500` | Delivery width |\n| `height` | -- | Delivery height |\n| `quality` | `80` | JPEG quality |\n| `format` | `auto` | Image format |\n| `fit` | `cover` | Resize fit mode |\n| `gravity` | -- | Crop gravity |\n\n## Development\n\n```bash\nnpm run dev\n```\n\n## Deploy\n\n```bash\nnpm run deploy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmblode%2Fheadless-screenshot-worker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmblode%2Fheadless-screenshot-worker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmblode%2Fheadless-screenshot-worker/lists"}