# @pixelbin/strapi-provider-upload

> Pixelbin provider for strapi upload

Latest version **1.0.2** (published 2024-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pixelbin/strapi-provider-upload
pnpm add @pixelbin/strapi-provider-upload
yarn add @pixelbin/strapi-provider-upload
bun add @pixelbin/strapi-provider-upload
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2024-06-13 |
| First published | 2023-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=14.19.1 <=18.x.x |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Pixelbin |
| Maintainers | pixelbin |
| Keywords | upload, pixelbin, strapi |

## Links

- npm: https://www.npmjs.com/package/@pixelbin/strapi-provider-upload
- npm.io page: https://npm.io/package/@pixelbin/strapi-provider-upload

## Dependencies (1)

- [@pixelbin/admin](https://npm.io/package/@pixelbin/admin.md) ^3.8.2

## Recent versions

- 1.0.2 (latest) — 2024-06-13
- 1.0.1 — 2024-03-22
- 1.0.0 — 2023-12-18

## README

# Strapi Upload Provider for Pixelbin.io

works with Strapi 4.

---

PixelBin.io: <https://www.pixelbin.io/>

Docs: <https://www.pixelbin.io/docs/>

Pre-install: create Pixelbin.io account.

## Installation

```
# using npm
npm install @pixelbin/strapi-provider-upload --save
```

## Parameters

| Parameter  | Description | Example |
| ------------- | ------------- | ------------- |
| PIXELBIN_SECRET | api secret | `a89a57f1-09f3-4z56-a282-4a746ce6cb6e` |
| folderName | Default path | "strapi-images" |

## Example

:zero:

Create Strapi project: ([docs](https://docs.strapi.io/dev-docs/quick-start)).

After successfully creating the project stop the dev server: `CTRL + C`.

:one:

Install upload plugin: `npm install @pixelbin/strapi-provider-upload --save`.

NOTE: Be sure that you are in a folder with your Strapi project: `cd strapi-pixelbin-cloud-project`.

After successful installation your package.json file will have a code:

```
"dependencies": {
    ...
    "@pixelbin/strapi-provider-upload": "^1.0.2",
    ...
  },
```

:two:

Go to code editor to your project folder and create config file for your bucket: `./config/plugins.js` (file `plugins.js` in `config` folder in the root of your Strapi project) with the code:



*Strapi v4*:

```javascript
module.exports = ({ env }) => ({
  upload: {
    config: {
      provider: "@pixelbin/strapi-provider-upload",
      providerOptions: {
        apiSecret: env("PIXELBIN_SECRET"),
        folderName: "strapi-images", //you can changes folder name anything you want
      },
      actionOptions: {
        upload: {},
        delete: {},
      },
    },
  },
});
```

*Strapi v4: Security Middleware Configuration*

Go to code editor to your project folder and create config file for your bucket: `./config/middlewares.js` (file `middlewares.js` in `config` folder in the root of your Strapi project) with the code:

```javascript

module.exports = [
  'strapi::errors',
  'strapi::cors',
  'strapi::poweredBy',
  'strapi::logger',
  'strapi::query',
  'strapi::body',
  'strapi::favicon',
  'strapi::public',
   {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        useDefaults: true,
        directives: {
          "connect-src": ["'self'", "https:"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
            "market-assets.strapi.io",
            "cdn.pixelbin.io",
          ],
          "media-src": [
            "'self'",
            "data:",
            "blob:",
            "market-assets.strapi.io",
            "cdn.pixelbin.io",
          ],
          upgradeInsecureRequests: null,
        },
      },
    },
  },
];
```


:three:

Create a .env file in the root of your Strapi project.

Example of `.env.local`:

```
HOST=0.0.0.0
PORT=1337

PIXELBIN_SECRET=a89a57f1-09f3-4z56-a282-4a746ce6cb6e
```

:four:

Test the new uploader.

1. Start Strapi dev server: `npm run develop`.

2. Open [Strapi media library v4](http://localhost:1337/admin/settings/media-library) in a browser and upload a test image.

---
_Source: https://npm.io/package/@pixelbin/strapi-provider-upload · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
