Image URLs & CDN
Get CDN URLs for product and category images.
Updated
On this page
Overview
All images and files served through DashForDevs use a CDN (Content Delivery Network) for fast, global delivery. Image URLs are permanent and optimized for web performance.
Image URL Format
Images are served from https://cdn.dashfordevs.com/ or your configured S3/CDN domain.
const { product } = await dash.products.get("blue-dream")
console.log(product.main_image)
// "https://cdn.dashfordevs.com/media/products/blue-dream-main.jpg"
Fetching Media by Name
import dash from "@/lib/dash"
const { file } = await dash.media.getByName("hero-banner")
// file = { id, name, url, alt_text, width, height }
Media Folders
const { folder, items } = await dash.media.getFolder("banners")
// items = [{ id, name, url, alt_text, width, height }, ...]
Next.js Image Optimization
Use Next.js <Image> component with CDN URLs for automatic optimization:
import Image from "next/image"
// Add CDN domain to next.config.js
// images: { remotePatterns: [{ hostname: "cdn.dashfordevs.com" }] }
<Image
src={product.main_image}
alt={product.name}
width={400}
height={400}
/>
REST API
# Get file by name
GET /storefront/media/by-name/hero-banner
X-API-Key: pk_live_your_key
# Get folder contents
GET /storefront/media/folder/banners
X-API-Key: pk_live_your_key
Next Steps
- Media Library — Managing media in the dashboard
- File Size Limits — Upload restrictions