{"_id":"@devondragon/emdash-plugin-featured-image-studio","_rev":"5-a8619e1118fa498ffcbf0a08e9ff4495","name":"@devondragon/emdash-plugin-featured-image-studio","dist-tags":{"latest":"0.3.0"},"versions":{"0.2.0":{"name":"@devondragon/emdash-plugin-featured-image-studio","version":"0.2.0","keywords":["emdash","emdash-plugin","cms","images","unsplash","media","featured-image"],"author":{"name":"Devon Hillard","email":"devon@devondragon.com"},"license":"MIT","_id":"@devondragon/emdash-plugin-featured-image-studio@0.2.0","maintainers":[{"name":"devondragon","email":"devon@justblackmagic.com"}],"homepage":"https://github.com/devondragon/emdash-plugins/tree/main/packages/featured-image-studio#readme","bugs":{"url":"https://github.com/devondragon/emdash-plugins/issues"},"dist":{"shasum":"55f727235068db7e809de33481084bb05540154b","tarball":"https://registry.npmjs.org/@devondragon/emdash-plugin-featured-image-studio/-/emdash-plugin-featured-image-studio-0.2.0.tgz","fileCount":7,"integrity":"sha512-3mcZ6x6BBqB/b+/RoF6vpa16xqJwyCfEr7qK+voqhLlKwMyffaRHDLzK9/r7pCiJDdF0D8MRwSW8j0iYB7+3eg==","signatures":[{"sig":"MEUCIQDBMe4V/AFsMu9cwTiEtz6RqsVdP41ijqptrt47lnsn2gIgf9C9uzFcFzRQ55L+RlRFVdKdvkrR8NwRme7fbNZbHXs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":54752},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./admin":{"types":"./dist/admin.d.ts","import":"./dist/admin.js"}},"gitHead":"d8d7f4e27b7373902a9d70c7bbb390300904525d","scripts":{"dev":"tsdown --watch","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"devondragon","email":"devon@justblackmagic.com"},"repository":{"url":"git+https://github.com/devondragon/emdash-plugins.git","type":"git","directory":"packages/featured-image-studio"},"_npmVersion":"11.12.1","description":"EmDash plugin: unified featured-image picker with stock photo search (Unsplash) and field-widget editor integration. AI generation planned for v0.2.","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","react":"^19.2.4","emdash":"^0.1.0","tsdown":"^0.21.0","typescript":"^5.9.3","@types/react":"^19.2.14","@cloudflare/kumo":"^1.17.0","@phosphor-icons/react":"^2.1.10"},"peerDependencies":{"zod":"^4.0.0","react":"^19.0.0","emdash":"^0.1.0","@cloudflare/kumo":"^1.0.0","@phosphor-icons/react":"^2.1.10"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-featured-image-studio_0.2.0_1775761407999_0.8214149374285202","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@devondragon/emdash-plugin-featured-image-studio","version":"0.2.1","keywords":["emdash","emdash-plugin","cms","images","unsplash","media","featured-image"],"author":{"name":"Devon Hillard","email":"devon@devondragon.com"},"license":"MIT","_id":"@devondragon/emdash-plugin-featured-image-studio@0.2.1","maintainers":[{"name":"devondragon","email":"devon@justblackmagic.com"}],"homepage":"https://github.com/devondragon/emdash-plugins/tree/main/packages/featured-image-studio#readme","bugs":{"url":"https://github.com/devondragon/emdash-plugins/issues"},"dist":{"shasum":"a27e90825796221fdbc571385e2d111f4353b420","tarball":"https://registry.npmjs.org/@devondragon/emdash-plugin-featured-image-studio/-/emdash-plugin-featured-image-studio-0.2.1.tgz","fileCount":7,"integrity":"sha512-9InJjx2iTk2WEHU660X/Dst/aAzngmivC+ISKQ9Rty2qw6ErqWxa7UwXR3dqyAqWpPWka4fcq0AFGpfmCKsyxw==","signatures":[{"sig":"MEUCIHUWK81Wcaiav4SxcNCQd88FBRjFkCgkB1UZSXAuj2XLAiEAxwW3v7dBElWBHg87MWhhErgckAL9b6vmdop/yrBQL8g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@devondragon%2femdash-plugin-featured-image-studio@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56707},"main":"./dist/index.js","type":"module","_from":"file:devondragon-emdash-plugin-featured-image-studio-0.2.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./admin":{"types":"./dist/admin.d.ts","import":"./dist/admin.js"}},"scripts":{"dev":"tsdown --watch","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8ba8288d-a22e-4b01-8710-d24911ceabd6"}},"_resolved":"/tmp/debb497f5414f58b3bb6382548ff19fb/devondragon-emdash-plugin-featured-image-studio-0.2.1.tgz","_integrity":"sha512-9InJjx2iTk2WEHU660X/Dst/aAzngmivC+ISKQ9Rty2qw6ErqWxa7UwXR3dqyAqWpPWka4fcq0AFGpfmCKsyxw==","repository":{"url":"git+https://github.com/devondragon/emdash-plugins.git","type":"git","directory":"packages/featured-image-studio"},"_npmVersion":"11.12.1","description":"EmDash plugin: unified featured-image picker with stock photo search (Unsplash) and field-widget editor integration. AI generation planned for v0.2.","directories":{},"_nodeVersion":"24.14.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","react":"^19.2.4","emdash":"^0.4.0","tsdown":"^0.21.0","typescript":"^5.9.3","@types/react":"^19.2.14","@cloudflare/kumo":"^1.17.0","@phosphor-icons/react":"^2.1.10"},"peerDependencies":{"zod":"^4.0.0","react":"^19.0.0","emdash":">=0.1.0","@cloudflare/kumo":"^1.0.0","@phosphor-icons/react":"^2.1.10"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-featured-image-studio_0.2.1_1776118511786_0.4079729739933602","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@devondragon/emdash-plugin-featured-image-studio","version":"0.2.2","keywords":["emdash","emdash-plugin","cms","images","unsplash","media","featured-image"],"author":{"name":"Devon Hillard","email":"devon@devondragon.com"},"license":"MIT","_id":"@devondragon/emdash-plugin-featured-image-studio@0.2.2","maintainers":[{"name":"devondragon","email":"devon@justblackmagic.com"}],"homepage":"https://github.com/devondragon/emdash-plugins/tree/main/packages/featured-image-studio#readme","bugs":{"url":"https://github.com/devondragon/emdash-plugins/issues"},"dist":{"shasum":"9e43318f4b3a3cbfb78f25d8fd24c1293c1f976b","tarball":"https://registry.npmjs.org/@devondragon/emdash-plugin-featured-image-studio/-/emdash-plugin-featured-image-studio-0.2.2.tgz","fileCount":7,"integrity":"sha512-IEOMbRwq9LZhkfBavTyqwR/nnCsjSP19p8ayqovvM6zltaDia6Ozgoia3uQO6dfuQ2xpRHBkTyebc+841YbJFA==","signatures":[{"sig":"MEQCIBbCt2sMyODQaaCgfzjTSNN+IMqAPmCuABFjT0YRU6wQAiBD9dUKvWnCfurDDQYhw/kXftSzCG00+J/B8KrMDpFjWg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":56714},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./admin":{"types":"./dist/admin.d.ts","import":"./dist/admin.js"}},"gitHead":"33ad83db63efae6a1fa6b39ffc1ec5ff12a85c12","scripts":{"dev":"tsdown --watch","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"devondragon","email":"devon@justblackmagic.com"},"repository":{"url":"git+https://github.com/devondragon/emdash-plugins.git","type":"git","directory":"packages/featured-image-studio"},"_npmVersion":"11.13.0","description":"EmDash plugin: unified featured-image picker with stock photo search (Unsplash) and field-widget editor integration. AI generation planned for v0.2.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","react":"^19.2.4","emdash":"^0.9.0","tsdown":"^0.21.0","typescript":"^5.9.3","@types/react":"^19.2.14","@cloudflare/kumo":"^1.17.0","@phosphor-icons/react":"^2.1.10"},"peerDependencies":{"zod":"^4.0.0","react":"^19.0.0","emdash":">=0.1.0","@cloudflare/kumo":"^1.0.0","@phosphor-icons/react":"^2.1.10"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-featured-image-studio_0.2.2_1777692233814_0.928736517328044","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@devondragon/emdash-plugin-featured-image-studio","version":"0.2.3","keywords":["emdash","emdash-plugin","cms","images","unsplash","media","featured-image"],"author":{"name":"Devon Hillard","email":"devon@devondragon.com"},"license":"MIT","_id":"@devondragon/emdash-plugin-featured-image-studio@0.2.3","maintainers":[{"name":"devondragon","email":"devon@justblackmagic.com"}],"homepage":"https://github.com/devondragon/emdash-plugins/tree/main/packages/featured-image-studio#readme","bugs":{"url":"https://github.com/devondragon/emdash-plugins/issues"},"dist":{"shasum":"471e4be132bda4393885ba8e6896c21683bddddd","tarball":"https://registry.npmjs.org/@devondragon/emdash-plugin-featured-image-studio/-/emdash-plugin-featured-image-studio-0.2.3.tgz","fileCount":7,"integrity":"sha512-jN+ircQ7y87ErB3nJPZgrrPGibjr9xeeMDiSU62052zF3dKeCeT4hXBkohodA4GBREyC4qnEoiXhg7gSjDL6gA==","signatures":[{"sig":"MEUCIQCd3m0t34BmBVfiHVbWV16xFkM5+9Sqqa3cxxM0g2589QIgASUedSGhI8GrbZb3VFyFsJZUotB8elUoArYLmO8vUY4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@devondragon%2femdash-plugin-featured-image-studio@0.2.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":57130},"main":"./dist/index.js","type":"module","_from":"file:devondragon-emdash-plugin-featured-image-studio-0.2.3.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./admin":{"types":"./dist/admin.d.ts","import":"./dist/admin.js"}},"scripts":{"dev":"tsdown --watch","build":"tsdown","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:8ba8288d-a22e-4b01-8710-d24911ceabd6"}},"_resolved":"/tmp/68f21208a109f7b47861b31fb0140356/devondragon-emdash-plugin-featured-image-studio-0.2.3.tgz","_integrity":"sha512-jN+ircQ7y87ErB3nJPZgrrPGibjr9xeeMDiSU62052zF3dKeCeT4hXBkohodA4GBREyC4qnEoiXhg7gSjDL6gA==","repository":{"url":"git+https://github.com/devondragon/emdash-plugins.git","type":"git","directory":"packages/featured-image-studio"},"_npmVersion":"11.16.0","description":"EmDash plugin: unified featured-image picker with stock photo search (Unsplash) and field-widget editor integration. AI generation planned for v0.2.","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","react":"^19.2.4","emdash":"^0.9.0","tsdown":"^0.21.0","typescript":"^5.9.3","@types/react":"^19.2.14","@cloudflare/kumo":"^1.17.0","@phosphor-icons/react":"^2.1.10"},"peerDependencies":{"zod":"^4.0.0","react":"^19.0.0","emdash":">=0.1.0","@cloudflare/kumo":"^1.0.0","@phosphor-icons/react":"^2.1.10"},"_npmOperationalInternal":{"tmp":"tmp/emdash-plugin-featured-image-studio_0.2.3_1783617417113_0.947704304496163","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@devondragon/emdash-plugin-featured-image-studio@0.3.0","bugs":{"url":"https://github.com/devondragon/emdash-plugins/issues"},"dist":{"shasum":"020f2ef5430a0c89a70617208aa08c10306a8f2d","tarball":"https://registry.npmjs.org/@devondragon/emdash-plugin-featured-image-studio/-/emdash-plugin-featured-image-studio-0.3.0.tgz","fileCount":7,"integrity":"sha512-Gmxqlm1Tj6GyX5t90LnOcS9AXHrQr7kM52529wfxxInD2J9PUCQvq9bbha9m30p3Pr5/yj5nGTRc3r5C30M24A==","signatures":[{"sig":"MEYCIQDk9qcOGQ7MKtHze2/Cz0eB3ExVhhdYxfopqPCu0HMrfQIhALo3twl9bf60KWnODqV81lxfIQcCxqbcHWIa+xdjocto","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCK5n0CINZTCipUbzp11ZRu8+i9y6UuJgq1ByS3IDlAJAIhAP9s8AEh/QXB9DCtHhy/BQDmgaM5b5i37qrvBH1h6UWH"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@devondragon%2femdash-plugin-featured-image-studio@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59619},"main":"./dist/index.js","name":"@devondragon/emdash-plugin-featured-image-studio","type":"module","_from":"file:devondragon-emdash-plugin-featured-image-studio-0.3.0.tgz","types":"./dist/index.d.ts","author":{"name":"Devon Hillard","email":"devon@devondragon.com"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./admin":{"types":"./dist/admin.d.ts","import":"./dist/admin.js"}},"license":"MIT","scripts":{"dev":"tsdown --watch","build":"tsdown","typecheck":"tsc --noEmit"},"version":"0.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"8ba8288d-a22e-4b01-8710-d24911ceabd6"}},"homepage":"https://github.com/devondragon/emdash-plugins/tree/main/packages/featured-image-studio#readme","keywords":["emdash","emdash-plugin","cms","images","unsplash","media","featured-image"],"_resolved":"/tmp/6c1c3eb03983a23aea4e0015a6e09fcd/devondragon-emdash-plugin-featured-image-studio-0.3.0.tgz","_integrity":"sha512-Gmxqlm1Tj6GyX5t90LnOcS9AXHrQr7kM52529wfxxInD2J9PUCQvq9bbha9m30p3Pr5/yj5nGTRc3r5C30M24A==","repository":{"url":"git+https://github.com/devondragon/emdash-plugins.git","type":"git","directory":"packages/featured-image-studio"},"_npmVersion":"11.19.0","description":"EmDash plugin: unified featured-image picker with stock photo search (Unsplash) and field-widget editor integration. AI generation planned for v0.2.","directories":{},"maintainers":[{"name":"devondragon","email":"devon@justblackmagic.com"}],"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","react":"^19.3.1","emdash":"^1.3.0","tsdown":"^0.21.0","typescript":"^5.9.3","@types/react":"^19.3.0","@cloudflare/kumo":"2.6.0","@phosphor-icons/react":"^2.1.10"},"peerDependencies":{"zod":"^4.0.0","react":"^19.0.0","emdash":">=1.0.1","@cloudflare/kumo":"^2.6.0","@phosphor-icons/react":"^2.1.10"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/emdash-plugin-featured-image-studio_0.3.0_1792289018010_0.7130601040150357"}}},"time":{"created":"2026-04-09T19:03:27.917Z","modified":"2026-10-18T02:03:38.406Z","0.2.0":"2026-04-09T19:03:28.145Z","0.2.1":"2026-04-13T22:15:11.967Z","0.2.2":"2026-05-02T03:23:53.966Z","0.2.3":"2026-07-09T17:16:57.252Z","0.3.0":"2026-10-18T02:03:38.085Z"},"bugs":{"url":"https://github.com/devondragon/emdash-plugins/issues"},"author":{"name":"Devon Hillard","email":"devon@devondragon.com"},"license":"MIT","homepage":"https://github.com/devondragon/emdash-plugins/tree/main/packages/featured-image-studio#readme","keywords":["emdash","emdash-plugin","cms","images","unsplash","media","featured-image"],"repository":{"url":"git+https://github.com/devondragon/emdash-plugins.git","type":"git","directory":"packages/featured-image-studio"},"description":"EmDash plugin: unified featured-image picker with stock photo search (Unsplash) and field-widget editor integration. AI generation planned for v0.2.","maintainers":[{"name":"devondragon","email":"devon@justblackmagic.com"}],"readme":"# @devondragon/emdash-plugin-featured-image-studio\n\nEmDash plugin that turns picking a featured image into a single unified experience: search Unsplash, pick a photo, and the plugin imports it into your media library — attribution and all. Works as a standalone admin page *and* as an in-editor field widget.\n\n> **v0.1 scope**: Stock search via **Unsplash** only. An \"AI Generation\" tab is present but disabled (planned for v0.2 via BYOK OpenAI Images / Replicate). Workers AI is not currently reachable from distributed EmDash plugins, so AI providers will be HTTP-based.\n\n## Requirements\n\n- EmDash `>=1.0.1` (tested against 1.3.0)\n- `@cloudflare/kumo` `^2.6.0` (provided by EmDash's admin)\n- React `^19`\n- An Unsplash **Access Key** (free tier — [apply here](https://unsplash.com/developers))\n\n## Installation\n\n```bash\npnpm add @devondragon/emdash-plugin-featured-image-studio\n```\n\n## Usage\n\nIn your `astro.config.mjs`:\n\n```ts\nimport { defineConfig } from \"astro/config\";\nimport emdash from \"emdash\";\nimport { featuredImageStudioPlugin } from \"@devondragon/emdash-plugin-featured-image-studio\";\n\nexport default defineConfig({\n  integrations: [\n    emdash({\n      plugins: [featuredImageStudioPlugin()],\n    }),\n  ],\n});\n```\n\nThen:\n\n1. Open **Plugins → Image Studio** in the EmDash admin and switch to the **Settings** tab to paste your Unsplash Access Key.\n2. Switch to the **Stock (Unsplash)** tab on the same page to search and import images directly into the media library.\n\n### Using it inside the Post editor\n\n**The post editor does not pick this up automatically.** EmDash stores a per-field `widget` setting in its database and only renders a plugin widget on fields that have been explicitly opted in. The plugin registers the widget name `featured-image-studio:picker`; you still need to bind it to each `image` / `file` field you want it to take over.\n\nThe supported path is the EmDash admin UI:\n\n1. Open **Collections** in the EmDash admin sidebar.\n2. Edit the collection that owns your featured image (e.g. `posts`).\n3. Edit the `image` / `file` field and set its **Widget** to `featured-image-studio:picker`.\n4. Save. Reload the post editor — that field now renders the \"Media Library\" and \"Import / Generate\" buttons that open the Studio modal.\n\nThe widget stores the same value object EmDash's built-in image/file editors write (`{ id, provider: \"local\", alt, width, height, filename, mimeType, meta: { storageKey } }`), so `<Image image={entry.data.featured_image} />` renders it directly. Versions 0.2.x and earlier stored a bare media ID string; the widget still previews those, and re-picking the image rewrites the value in the new shape.\n\nIf you prefer to script it (e.g. in a seed or migration), the same binding can be written directly to the emdash schema table — the field's `widget` column takes the `plugin-id:widget-name` string. For the stock sqlite adapter that is:\n\n```sql\nUPDATE _emdash_fields\nSET widget = 'featured-image-studio:picker'\nWHERE slug = 'featured_image'\n  AND collection_id = (SELECT id FROM _emdash_collections WHERE slug = 'posts');\n```\n\nOn Cloudflare D1 the same statement runs via `wrangler d1 execute`. Remember to apply it to both your local dev DB and production.\n\n## Features\n\n- **Unsplash search** — paginated grid with orientation filter, per-photo attribution.\n- **One-click import** — downloads the full-size image, uploads to the media library, pings Unsplash's tracking endpoint per their API guidelines, stores photographer attribution metadata.\n- **Field widget** — replaces the default image picker on any image field the user opts in via schema.\n- **Standalone admin page** — search and import outside of any post editing session.\n- **Settings page** — BYOK key entry (via EmDash's auto-generated settings form) plus TOS / rate-limit notes.\n\n## Capabilities\n\nThis plugin declares:\n\n- `network:request` (restricted to `api.unsplash.com` + `images.unsplash.com`)\n\nImage imports are sent through the authenticated EmDash admin media API (`/_emdash/api/media`); the plugin does not declare or use a separate `media:write` capability. No access to site content, users, or email.\n\n## Admin CSP & Unsplash thumbnails\n\nUnsplash thumbnails render out of the box on all released EmDash versions — no CSP configuration needed.\n\nAn early pre-release build of EmDash hardcoded the admin Content-Security-Policy `img-src` to `'self' data: blob:`, which blocked `https://images.unsplash.com` and left blank tiles in the search grid (titles and attribution still showed) — see [emdash-cms/emdash#415](https://github.com/emdash-cms/emdash/issues/415). That is **fixed in every published EmDash release** (0.16.1+): the admin CSP is now `img-src 'self' https: data: blob:`, which allows any HTTPS origin. And because this plugin proxies the Unsplash API server-side (browser calls only ever hit same-origin `/_emdash` routes), `connect-src 'self'` is sufficient — **no worker CSP patching is required.**\n\n<details>\n<summary>Historical workaround (only needed on pre-0.16 EmDash builds)</summary>\n\nIf you are pinned to a pre-release EmDash build with the strict `img-src`, wrap your Cloudflare Workers entrypoint to patch the outbound CSP header on `/_emdash` responses. Patching from Astro user middleware (`src/middleware.ts`) does *not* work — EmDash's middleware runs outside user middleware and overwrites the header after user middleware returns.\n\n```ts\n// src/worker.ts\nimport handler from \"@astrojs/cloudflare/entrypoints/server\";\nexport { PluginBridge } from \"@emdash-cms/cloudflare/sandbox\";\n\nconst wrapped: ExportedHandler = {\n  async fetch(request, env, ctx) {\n    const response = await (handler as any).fetch(request, env, ctx);\n    const url = new URL(request.url);\n    if (!url.pathname.startsWith(\"/_emdash\")) return response;\n\n    const csp = response.headers.get(\"Content-Security-Policy\");\n    if (!csp || csp.includes(\"images.unsplash.com\")) return response;\n\n    const patched = csp\n      .replace(/img-src ([^;]*)/, \"img-src $1 https://images.unsplash.com\")\n      .replace(/connect-src ([^;]*)/, \"connect-src $1 https://api.unsplash.com\");\n\n    const newHeaders = new Headers(response.headers);\n    newHeaders.set(\"Content-Security-Policy\", patched);\n    return new Response(response.body, {\n      status: response.status,\n      statusText: response.statusText,\n      headers: newHeaders,\n    });\n  },\n};\n\nexport default wrapped;\n```\n\nYou'll also need to point `wrangler.jsonc` at this file (`\"main\": \"./src/worker.ts\"`).\n\n</details>\n\n## Roadmap\n\n- **v0.2**: BYOK OpenAI Images + Replicate AI generation, Pexels + Openverse stock providers.\n- **v0.3**: Auto-crop to responsive variants, AI-generated alt-text.\n\n## License\n\nMIT © Devon Hillard\n","readmeFilename":"README.md"}