{"_id":"@dev.w-strapi/strapi-provider-firebase-storage--for_low_mem","name":"@dev.w-strapi/strapi-provider-firebase-storage--for_low_mem","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@dev.w-strapi/strapi-provider-firebase-storage--for_low_mem","version":"1.0.0","description":"This version is a custom version of Author SAM Redmond's Strapi-Provider-Firebase-Storage. A storage provider for the Strapi CMS that manages file uploads to Firebase Storage. This version is optimized for low memory environments by excluding the 'sharp' ","main":"dist/index.js","directories":{"lib":"./lib"},"scripts":{"build":"tsc"},"prepublishOnly":"npm run build","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/bizLsw91/strapi-provider-firebase-storage--for_low_mem.git"},"keywords":["Strapi","Firebase","Firebase Storage"],"author":{"name":"dev.w"},"license":"MIT","bugs":{"url":"https://github.com/bizLsw91/strapi-provider-firebase-storage--for_low_mem/issues"},"homepage":"https://github.com/bizLsw91/strapi-provider-firebase-storage--for_low_mem#readme","devDependencies":{"@tsconfig/node16":"1.0.3","@types/sharp":"^0.31.1","@types/uuid":"^9.0.2"},"dependencies":{"@types/node":"^20.19.11","firebase-admin":"^13.4.0","sharp":"^0.33.4","typescript":"^4.9.4","uuid":"^9.0.0"},"_id":"@dev.w-strapi/strapi-provider-firebase-storage--for_low_mem@1.0.0","gitHead":"2aee1f5c2f3b2f7d2b477a747d7685344b555866","_nodeVersion":"20.18.1","_npmVersion":"11.1.0","dist":{"integrity":"sha512-n80TGCgFCCApsqkBaudDaF/I1aRGiE4tfLdECkdRnU/P+dpBUy3N2GguOcNb+0apIt50CSWKIiy3YUGjjkdBSg==","shasum":"3fd0bdce82841805d7fec369f2bd66b8d1c61353","tarball":"https://registry.npmjs.org/@dev.w-strapi/strapi-provider-firebase-storage--for_low_mem/-/strapi-provider-firebase-storage--for_low_mem-1.0.0.tgz","fileCount":5,"unpackedSize":19810,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC5XO3XLoaC/aCSS5Y0bcgzkILQ5FhW1WKszuEEj0E7kwIhAM5Igl+PA2LREwuLvNJkWeiZC5pjvVBiAqcE/Wr9+XAf"}]},"_npmUser":{"name":"dev.woong","email":"dev.lsw91@gmail.com"},"maintainers":[{"name":"dev.woong","email":"dev.lsw91@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strapi-provider-firebase-storage--for_low_mem_1.0.0_1756320916693_0.9510882915079826"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-27T18:55:16.623Z","1.0.0":"2025-08-27T18:55:16.914Z","modified":"2025-08-27T18:55:17.495Z"},"maintainers":[{"name":"dev.woong","email":"dev.lsw91@gmail.com"}],"description":"This version is a custom version of Author SAM Redmond's Strapi-Provider-Firebase-Storage. A storage provider for the Strapi CMS that manages file uploads to Firebase Storage. This version is optimized for low memory environments by excluding the 'sharp' ","homepage":"https://github.com/bizLsw91/strapi-provider-firebase-storage--for_low_mem#readme","keywords":["Strapi","Firebase","Firebase Storage"],"repository":{"type":"git","url":"git+https://github.com/bizLsw91/strapi-provider-firebase-storage--for_low_mem.git"},"author":{"name":"dev.w"},"bugs":{"url":"https://github.com/bizLsw91/strapi-provider-firebase-storage--for_low_mem/issues"},"license":"MIT","readme":"# Strapi Provider Firebase Storage\r\n\r\n<p align=\"center\">\r\n    <img src=\"https://i.imgur.com/3K2Y6g3.png\">\r\n</p>\r\n\r\n⚠️ 커스텀 버전\r\n\r\n이 레포지토리는 strapi-provider-firebase-storage 를 기반으로 이미지 압축·리사이징·WebP 변환 기능을 추가한 커스텀 구현입니다. 저메모리 환경에 최적화 하였습니다. npm 에는 strapi-provider-firebase-storage--for_low_mem 라는 이름으로 배포됩니다.\r\n사용하기 위해서는 src/index.ts 를 알맞게 수정한 뒤, 일반적인 Strapi Provider 사용법을 따르시면 됩니다.\r\n\r\n# Installation \r\n\r\n```\r\nnpm install @dev.w-strapi/strapi-provider-firebase-storage--for_low_mem\r\n```\r\n\r\n## Note on CORS options\r\n\r\nYou may run into an issue displaying the image where CORS is blocking it. If that happens open `./config/middwares.js` and replace `strapi::security` with this:\r\n\r\n```\r\n{\r\n  name: \"strapi::security\",\r\n  config: {\r\n    contentSecurityPolicy: {\r\n      useDefaults: true,\r\n      directives: {\r\n        \"connect-src\": [\"'self'\", \"https:\"],\r\n        \"img-src\": [\r\n          \"'self'\",\r\n          \"data:\",\r\n          \"blob:\",\r\n          \"storage.googleapis.com\",\r\n          \"dl.airtable.com\",\r\n        ],\r\n        \"media-src\": [\r\n          \"'self'\",\r\n          \"data:\",\r\n          \"blob:\",\r\n          \"storage.googleapis.com\",\r\n          \"dl.airtable.com\",\r\n        ],\r\n        upgradeInsecureRequests: null,\r\n      },\r\n    },\r\n  },\r\n},\r\n```\r\n\r\nIt will whitelabel images coming from Google Cloud Storage in the CORS settings.\r\n\r\n# Usage\r\n\r\nHere is a sample usage:\r\nplugins.ts\r\n\r\n```typescript\r\nexport default ({ env }) => ({\r\n    upload: {\r\n      config: {\r\n        breakpoints: {},\r\n        provider: \"@dev.w-strapi/strapi-provider-firebase-storage--for_low_mem\",\r\n        providerOptions: {\r\n          serviceAccount: require(\"path/to/my/serviceAccount.json\"),\r\n          // Custom bucket name\r\n          bucket: env(\r\n            \"STORAGE_BUCKET_URL\",\r\n            \"my-bucket-name.appspot.com\"\r\n          ),\r\n          sortInStorage: true, // true | false\r\n          debug: false, // true | false\r\n          defaultDirPath: \"my-default-folder\", // optional\r\n          defaultQuality: 90, // 이미지 압축을 시작할 품질 (default: 90)\r\n          resizeOptions: {}, // Sharp 에 넘겨줄 리사이징 옵션 ex) {width: 1921, withoutEnlargement:true}\r\n        },\r\n      },\r\n    },\r\n});\r\n```\r\n\r\n# Config Options\r\n\r\n| Option             | Is Required | Default | Notes                                                                                                                      |\r\n|:-------------------|:------------|:--------|:---------------------------------------------------------------------------------------------------------------------------|\r\n| `breakpoints`      | false       | none    | 오리지널 이미지와 썸네일 이미지 외의 반응형 이미지를 생성하지 않고 싶을 때 위와 같이 빈 오브젝트로 설정하면 됩니다.                                                         |\r\n| `serviceAccount`   | true        | none    | This is just the path to your service account file                                                                         |\r\n| `bucket`           | false       | none    | If you leave this blank it **should** go to your default bucket, but I'd recommend putting your default bucket name anyway |\r\n| `sortInStorage`    | false       | true    | This will sort files in your firebase storage bucket into folders                                                          |\r\n| `debug`            | false       | false   | This will just log all the steps to the console                                                                            |\r\n| `defaultDirPath`   | false       | none    |                                                                                                                            |\r\n| `defaultQuality`   | false       | 90      | 이미지 압축을 시작할 품질                                                                                                             |\r\n| `resizeOptions`    | false       | {}      | Sharp 에 넘겨줄 리사이징 옵션 ex) {width: 1921, withoutEnlargement:true}                                                             |\r\n\r\n## Notes on the `sortInStorage` option\r\n\r\nBy default Strapi will just output all the files in the default bucket with no folder structure (even if you make folders in the Strapi admin UI). Strapi also creates\r\nvariants of files (like iamges ex. thumbnails) so if you upload an image to Strapi you'll actually have like a few variants of it actually uploaded to Firebase.\r\n\r\nIf you were to look at that in Firebase it would look like total chaos. So what I did was create a couple of functions that will upload your files based on mime type\r\nas well as sort all variants of an image under a single folder. If you wanted to do something else with those images (for example create triggers for uploads for specific folders)\r\nthey will be sorted nicely for you.\r\n\r\nAlso be really careful toggling the `sortInStorage` option. If you have it on, upload some files, then turn it off the\r\ndelete function **could** break for the files that were uploaded when it was turned on.\r\n","readmeFilename":"README.md","_rev":"1-5ab972f1b1cfd85e0322d235afe56fbd"}