The admin uploads images through the API to a cloud image provider. Choose one with DEFAULT_UPLOAD_PROVIDER in apps/api/.env.
ImageKit (imagekit)
- Sign up at imagekit.io.
- Open Developer options → API keys.
DEFAULT_UPLOAD_PROVIDER=imagekit
IMAGEKIT_PUBLIC_KEY=public_...
IMAGEKIT_PRIVATE_KEY=private_...
IMAGEKIT_URL_ENDPOINT=https://ik.imagekit.io/your_id
Cloudinary (cloudinary)
- Sign up at cloudinary.com.
- Open console.cloudinary.com → Settings → API Keys.
DEFAULT_UPLOAD_PROVIDER=cloudinary
CLOUDINARY_CLOUD_NAME=...
CLOUDINARY_API_KEY=...
CLOUDINARY_API_SECRET=...
Amazon S3 (s3)
- Create a bucket in the S3 console that allows public reads of uploaded objects.
- Create an IAM user with
s3:PutObjecton that bucket and an access key.
DEFAULT_UPLOAD_PROVIDER=s3
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
AWS_REGION=us-east-1
Let the storefront show your images
Next.js only loads images from known hosts. ImageKit and Cloudinary are allowed already. For S3 or any other host, add it to images.remotePatterns in apps/web/next.config.ts:
images: {
remotePatterns: [
{ protocol: "https", hostname: "your-bucket.s3.amazonaws.com" },
],
},
MAX_PRODUCT_IMAGES (API) and VITE_MAX_PRODUCT_IMAGES (admin) set how many images a product can have.
