Store images and other assets in MinIO, an open-source, S3-compatible object store.
npm install @vendure/asset-server-plugin
Support by
Support languages
en
Integration type
Core
Category
Storage
Repository
Package
Compatible with
^3.0.0
Latest version
3.1.1
Last published
Dec 17, 2024
Downloads in past month
13,372
Prerequisite
The AssetServerPlugin is part of a standard Vendure installation, but if it is not already installed, you must install it:
npm install @vendure/asset-server-plugin
Install AWS SDKs
Before using this strategy, make sure you have the @aws-sdk/client-s3
and @aws-sdk/lib-storage
packages installed:
npm install @aws-sdk/client-s3 @aws-sdk/lib-storage
Configure the AssetServerPlugin for MinIO
// vendure-config.ts
import { AssetServerPlugin, configureS3AssetStorage } from '@vendure/asset-server-plugin';
import { DefaultAssetNamingStrategy } from '@vendure/core';
// ...
plugins: [
AssetServerPlugin.init({
route: 'assets',
assetUploadDir: path.join(__dirname, 'assets'),
namingStrategy: new DefaultAssetNamingStrategy(),
storageStrategyFactory: configureS3AssetStorage({
bucket: 'my-minio-bucket',
credentials: {
accessKeyId: process.env.MINIO_ACCESS_KEY_ID,
secretAccessKey: process.env.MINIO_SECRET_ACCESS_KEY,
},
nativeS3Configuration: {
endpoint: process.env.MINIO_ENDPOINT ?? 'http://localhost:9000',
forcePathStyle: true,
signatureVersion: 'v4',
// The `region` is required by the AWS SDK even when using MinIO,
// so we just use a dummy value here.
region: 'eu-west-1',
},
}),
}),
Complete documentation
See the S3AssetStorageStrategy docs for full documentation.
Get started
Create your first commerce experience with Vendure in less than 2 minutes
Vendure is a registered trademark. Our trademark policy ensures that our brand and products are protected. Feel free to reach out if you have any questions about our trademarks.
Documentation
Newsletter
Get the latest product news and announcements delivered directly to your inbox.