# strapi-provider-storage-appwrite

> Appwrite storage provider for Strapi V4

Latest version **1.0.1** (published 2024-05-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install strapi-provider-storage-appwrite
pnpm add strapi-provider-storage-appwrite
yarn add strapi-provider-storage-appwrite
bun add strapi-provider-storage-appwrite
```

## 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.1 |
| Published | 2024-05-05 |
| First published | 2024-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18.x.x <=20.x.x |
| Dependencies | 1 |
| Unpacked size | 85.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jorge Agoiz Pedraja |
| Maintainers | jorgeagoiz |
| Keywords | appwrite, strapi, strapi-provider, appwrite-provider, storage, provider |

## Links

- npm: https://www.npmjs.com/package/strapi-provider-storage-appwrite
- Repository: https://github.com/jorgeAgoiz/strapi-provider-storage-appwrite
- Homepage: https://github.com/jorgeAgoiz/strapi-provider-storage-appwrite#readme
- Issues: https://github.com/jorgeAgoiz/strapi-provider-storage-appwrite/issues
- npm.io page: https://npm.io/package/strapi-provider-storage-appwrite

## Dependencies (1)

- [node-appwrite](https://npm.io/package/node-appwrite.md) 12.0.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2024-05-05
- 1.0.0 — 2024-04-27

## README

# strapi-provider-storage-appwrite

<div>
  <img title="Appwrite" alt="Appwrite logo" src="assets/logo-appwrite.png" width="140px" height="130px" />
  <img title="Strapi" alt="Strapi logo" src="assets/strapi-logo.png" width="140px" height="140px" />
</div>


## Resources

- [LICENSE](LICENSE)

## Links

- [Strapi website](https://strapi.io/)
- [Strapi documentation](https://docs.strapi.io)
- [Appwrite website](https://www.appwrite.io/)
- [Appwrite documentation](https://www.appwrite.io/docs)
- [Github repository](https://github.com/jorgeAgoiz/strapi-provider-storage-appwrite)

## Installation

```bash
# using yarn
yarn add strapi-provider-storage-appwrite

# using npm
npm install strapi-provider-storage-appwrite --save
```

## Configuration

- `provider` defines the name of the provider, in this case we must put "strapi-provider-storage-appwriter".
- `providerOptions` is passed down during the construction of the provider. (ex: `new StorageClient(config)`).
- `providerOptions.apiUrl` RESTful endpoint to manage your Appwrite project.
- `providerOptions.projectId` ID of your Appwrite project.
- `providerOptions.bucketId` ID of your Appwrite bucket.
- `sizeLimit` maximum size limit for your files on bytes.

See the [documentation about using a provider](https://docs.strapi.io/developer-docs/latest/plugins/upload.html#using-a-provider) for information on installing and using a provider. To understand how environment variables are used in Strapi, please refer to the [documentation about environment variables](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/optional/environment.html#environment-variables).

### Provider Configuration

`./config/plugins.js` or `./config/plugins.ts` for TypeScript projects:

```js
module.exports = ({ env }) => ({
  // ...
  upload: {
    config: {
      provider: "strapi-provider-storage-appwrite",
      providerOptions: {
        apiUrl: env("APPWRITE_API_ENDPOINT"),
        projectId: env("APPWRITE_PROJECT_ID"),
        bucketId: env("APPWRITE_BUCKET_ID"),
      },
      sizeLimit: 1000000000,
      actionOptions: {
        upload: {},
        uploadStream: {},
        delete: {},
        checkFileSize: {},
      },
    },
  },
  // ...
});
```

### Security Middleware Configuration

Due to the default settings in the Strapi Security Middleware you will need to modify the `contentSecurityPolicy` settings to properly see thumbnail previews in the Media Library. You should replace `strapi::security` string with the object bellow instead as explained in the [middleware configuration](https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/configurations/required/middlewares.html#loading-order) documentation.

`./config/middlewares.js`

```js
module.exports = [
  // ...
  {
    name: "strapi::security",
    config: {
      contentSecurityPolicy: {
        directives: {
          "default-src": ["'self'"],
          "img-src": [
            "'self'",
            "data:",
            "blob:",
            env("APPWRITE_API_DIRECTIVE"),
            // Example: "https://cloud.appwrite.io"
          ],
        },
      },
    },
  },
  // ...
];
```

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