DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsInventoryProduct Images
Introduction
Getting Started
Authentication
Products
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Stock ManagementBrandsProduct Custom FieldsBulk ImportProduct ImagesProduct SubscriptionsSubscription Checkout And RenewalsSubscription Self-Service And EmailsSubscriptions In Your Dashboard
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Product Images

Upload and manage product media.

Updated March 29, 2026

On this page
  • Overview
  • Image Data
  • Image Gallery Component
  • Uploading Images
  • Next Steps

Overview

Products support multiple images including a main image and a gallery. Images are served from a CDN for fast loading.

Image Data

typescript
import dash from "@/lib/dash"

const { product } = await dash.products.get("blue-dream")

// Main image
console.log(product.main_image) // "https://cdn.dashfordevs.com/..."

// Gallery images
product.images.forEach(img => {
  console.log(img.image, img.alt_text, img.order)
})

// Variation-specific images
product.attributes[0].options.forEach(opt => {
  console.log(opt.value, opt.image) // Each variation can have its own image
})

Image Gallery Component

typescript
"use client"
import { useState } from "react"

export function ProductGallery({ mainImage, images }) {
  const [selected, setSelected] = useState(mainImage)

  const allImages = [mainImage, ...images.map(i => i.image)].filter(Boolean)

  return (
    <div>
      <img src={selected} alt="Product" className="w-full rounded" />
      <div className="flex gap-2 mt-2">
        {allImages.map((img, i) => (
          <img key={i} src={img} alt={`View ${i + 1}`}
               className={`w-16 h-16 rounded cursor-pointer ${selected === img ? "ring-2 ring-blue-500" : ""}`}
               onClick={() => setSelected(img)} />
        ))}
      </div>
    </div>
  )
}

Uploading Images

Upload images via the upload module or the dashboard.

Next Steps

  • Upload Files — File upload API
  • Image URLs & CDN — CDN and image optimization
  • Get Product by Slug — Full product with images
PreviousBulk ImportNextProduct Subscriptions

On this page

  • Overview
  • Image Data
  • Image Gallery Component
  • Uploading Images
  • Next Steps