{"id":17468251,"url":"https://github.com/zapal-tech/payload-blurhash-plugin","last_synced_at":"2025-07-19T23:05:17.135Z","repository":{"id":202825938,"uuid":"706679910","full_name":"zapal-tech/payload-blurhash-plugin","owner":"zapal-tech","description":"Dead simple BlurHash auto generation plugin for Payload CMS","archived":false,"fork":false,"pushed_at":"2023-12-15T02:32:58.000Z","size":1533,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-07T22:08:43.834Z","etag":null,"topics":["payload","payload-cms","payload-plugin","payloadcms","typescript"],"latest_commit_sha":null,"homepage":"","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/zapal-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-18T12:24:57.000Z","updated_at":"2025-02-07T18:32:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4dfbfd2-af2d-4aa8-a4bf-fdf6d440757b","html_url":"https://github.com/zapal-tech/payload-blurhash-plugin","commit_stats":null,"previous_names":["zapal-tech/payload-blurhash-plugin"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapal-tech%2Fpayload-blurhash-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapal-tech%2Fpayload-blurhash-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapal-tech%2Fpayload-blurhash-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zapal-tech%2Fpayload-blurhash-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zapal-tech","download_url":"https://codeload.github.com/zapal-tech/payload-blurhash-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249527592,"owners_count":21286379,"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":["payload","payload-cms","payload-plugin","payloadcms","typescript"],"created_at":"2024-10-18T15:05:41.151Z","updated_at":"2025-04-19T23:55:38.453Z","avatar_url":"https://github.com/zapal-tech.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Payload CMS BlurHash Plugin by Zapal\n\n[![](/github-banner.jpg)](https://www.zapal.tech)\n\nTurbocharge your website performance by creating ultralight image placeholders, resulting in a smoother user experience.\n\n### 📋 Requirements\n\n- Payload version `1.7.2` or higher is required (version `2.0.0` or higher is recommended)\n\n## 🚀 Getting started\n\nInstal the package with `yarn add @zapal/payload-blurhash-plugin` or `npm install @zapal/payload-blurhash-plugin`\n\nNow setup the plugin within your `payload.config.ts` file as follows:\n\n```ts\nimport { buildConfig } from 'payload/config';\n\nimport { blurHash } from '@zapal/payload-blurhash-plugin';\nimport path from 'path';\n\n/* ... */\n\nexport default buildConfig({\n  plugins: [\n    blurHash({\n      collections: ['team-photos-collection', 'blog-images-collection'],\n    }),\n  ],\n  /* ... */\n});\n```\n\nThe plugin will generate a readonly `blurhash` field for each image uploaded to the specified collections. Generation\nfor `imageSizes` are not supported yet (but it's in progress).\n\n### 🎛️ Conditionally enabling/disabling\n\nThe proper way to conditionally enable/disable this plugin is to use the `enabled` property.\n\n```ts\nblurHash({\n  enabled: process.env.ENABLE_BLURHASH_PLUGIN === 'true',\n  collections: ['team-photos-collection', 'blog-images-collection'],\n}),\n```\n\n## ⚙️ Plugin options\n\nThis plugin is configurable to work across upload-enabled Payload collections. A `*` denotes that the property is\nrequired.\n\n| Option           | Type     | Description                                                                   |\n| ---------------- | -------- | ----------------------------------------------------------------------------- |\n| `collections` \\* | string[] | Array of upload-enabled collections' slugs you want to enable the plugin for. |\n| `enabled`        | boolean  | Conditionally enable/disable plugin. Default: true.                           |\n| `width`          | number   | Width to resize the image before computing the blurhash. Default: 32.         |\n| `height`         | number   | Height to resize the image before computing the blurhash. Default: 32.        |\n| `componentX`     | number   | X component count to pass to the blurhash encoder. Default: 3.                |\n| `componentY`     | number   | Y component count to pass to the blurhash encoder. Default: 3.                |\n\nSee more information about the `width`, `height`, `componentX`, `componentY` options and BlurHash encoder\n[here](https://github.com/woltapp/blurhash#good-questions).\n\n## 💻 Local development\n\nYou can find the source code in the `src` directory. For development purposes, you can use the `dev` directory with all\nthe necessary files to test the plugin in a Payload project. Also we are strongly recommending to use your IDE debugger\ninstead of `console.log` statements.\n\nYou need to follow these steps to start developing and testing the plugin locally:\n\n1. Go to `dev` directory (`cd dev`)\n2. Create `.env` file (`cp .env.example .env`)\n3. Setup environment variables in `.env` file\n4. Install dependencies (`npm i`)\n5. Run the project (`npm run dev`)\n\nAnd you are ready to go!\n\n## 🤝 Contributing\n\nWe are open to, and grateful for, any contributions made by the community.\n\nWe are planning to add more features to this plugin in the future. If you have any ideas, create an issue to discuss it.\n\nNext steps (v1):\n\n- [ ] Optional blurhash generation for `imageSizes` (in progress)\n- [ ] Custom field name support\n- [ ] Unit tests\n- [ ] Code refactoring\n\nNext steps (v2):\n\n- [ ] Custom options for each collection\n\n## 🛡️ License\n\nThis project is licensed under the [MIT License](/LICENSE)\n\n## ⭐ Like what we're doing? Give us a star\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapal-tech%2Fpayload-blurhash-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzapal-tech%2Fpayload-blurhash-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzapal-tech%2Fpayload-blurhash-plugin/lists"}