{"id":19429622,"url":"https://github.com/bene/astro-remote-picture","last_synced_at":"2026-01-15T22:10:24.467Z","repository":{"id":226513104,"uuid":"768898414","full_name":"bene/astro-remote-picture","owner":"bene","description":"Dynamic images with the performance benefits of the Picture and Image components of Astro. 💨","archived":false,"fork":false,"pushed_at":"2024-06-05T11:43:23.000Z","size":119,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T20:22:58.490Z","etag":null,"topics":["astro","astro-integration"],"latest_commit_sha":null,"homepage":"","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/bene.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}},"created_at":"2024-03-07T23:52:46.000Z","updated_at":"2024-06-05T11:43:26.000Z","dependencies_parsed_at":"2025-02-08T19:42:01.997Z","dependency_job_id":"7c1a190a-ad8b-4815-8845-81209a04b294","html_url":"https://github.com/bene/astro-remote-picture","commit_stats":null,"previous_names":["bene/astro-remote-picture"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bene/astro-remote-picture","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bene%2Fastro-remote-picture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bene%2Fastro-remote-picture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bene%2Fastro-remote-picture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bene%2Fastro-remote-picture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bene","download_url":"https://codeload.github.com/bene/astro-remote-picture/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bene%2Fastro-remote-picture/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472624,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T20:50:13.584Z","status":"ssl_error","status_checked_at":"2026-01-15T20:49:17.379Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["astro","astro-integration"],"created_at":"2024-11-10T14:20:15.004Z","updated_at":"2026-01-15T22:10:24.454Z","avatar_url":"https://github.com/bene.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# astro-remote-pictures\n\nThis integration enables you to use dynamic images with the performance benefits of the `\u003cPicture /\u003e` and `\u003cImage /\u003e` components of Astro.\n\n## Installation\n\n```bash\nnpm i astro-remote-pictures\n```\n\n## Basic example\n\nThis example just uses static URLs to demonstrate the basic usage of the integration. It doesn't make much sense to use this for static URLs, but it's a good starting point to understand how it works. See the dynamic example [below](#dynamic-example).\n\n### Configuration\n\n```javascript filename=\"astro.config.mjs\"\nimport { defineConfig } from \"astro/config\";\nimport remotePictures from \"astro-remote-pictures\";\n\nexport default defineConfig({\n  integrations: [\n    remotePictures({\n      collections: [\n        {\n          id: \"backgrounds\",\n          pictures: [\n            {\n              id: \"PolarBear\",\n              url: \"https://images.unsplash.com/photo-1709048260183-44acb7826928\",\n            },\n          ],\n        },\n      ],\n    }),\n  ],\n});\n```\n\n### Usage\n\n```astro\n---\nimport { Picture } from \"astro:assets\";\nimport { PolarBear } from \"astro-remote-pictures/wallpapers\";\n---\n\n\u003cPicture\n  src={PolarBear}\n  alt=\"A polar bear\"\n/\u003e\n```\n\nThe `PolarBear` import is a reference to the picture with the ID `PolarBear` from the `backgrounds` collection. The integration automatically generates these references for you. The import path is always `astro-remote-pictures/$collectionId`.\n\n## Dynamic example\n\nThis integration really starts to make sense once you want to use images dynamically fetched from an CMS or any other API.\n\n### Configuration\n\n```javascript filename=\"astro.config.mjs\"\nimport { defineConfig } from \"astro/config\";\nimport remotePictures, { toPictureId } from \"astro-remote-pictures\";\n\n// Fetch wallpapers from API\nconst wallpapers = await fetch(...)\n\nexport default defineConfig({\n  integrations: [\n    remotePictures({\n      fetchOptions: {\n        headers: {\n            \"Authorization\": \"Bearer super_secret_token\"\n        }\n      },\n      collections: [\n        {\n          id: \"wallpapers\",\n          pictures: wallpapers.map(wallpaper =\u003e ({\n            id: toPictureId(wallpaper.name),\n            url: wallpaper.url,\n          })),\n        },\n      ],\n    }),\n  ],\n});\n```\n\n### Usage\n\n```astro\n---\nimport { Picture } from \"astro:assets\";\nimport { toPictureId } from \"astro-remote-pictures\";\n\n// Import all pictures from the wallpapers collection\nimport * as wallpaperRefs from \"astro-remote-pictures/wallpapers\";\n\n// Fetch wallpapers from API\nconst wallpapers = fetch(...)\n---\n\n{wallpapers.map(wallpaper =\u003e (\n  \u003cPicture\n    src={wallpaperRefs[toPictureId(wallpaper.name)]}\n    alt={wallpaper.name}\n  /\u003e\n))}\n```\n\n### Notes\n\nYou can move the `fetch` call to a separate file and import it in your Astro config file and the Astro component to remove code duplication.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbene%2Fastro-remote-picture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbene%2Fastro-remote-picture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbene%2Fastro-remote-picture/lists"}