Official Integration & SDK
Zero-Cost Image Optimization for Next.js 14, 15 & 16
Eliminate expensive Vercel image optimization overages. SmallPict serves as a high-performance custom loader for next/image, providing AVIF/WebP streaming, edge caching, and blurhash placeholders.
Install:
TYPESCRIPT Packagenpm install @smallpict/nextImplementation Example
typescript// smallpict-loader.ts
export default function smallPictLoader({ src, width, quality }: { src: string; width: number; quality?: number }) {
const params = new URLSearchParams({
url: src,
w: width.toString(),
q: (quality || 80).toString(),
f: 'auto'
});
return `https://cdn.smallpict.app/v1/optimize?${params.toString()}`;
}
// next.config.ts
import type { NextConfig } from 'next';
const nextConfig: NextConfig = {
images: {
loader: 'custom',
loaderFile: './smallpict-loader.ts',
},
};
export default nextConfig;Integration Steps
11. Create smallpict-loader.ts
Configure the lightweight loader function pointing to SmallPict CDN.
22. Register in next.config.ts
Set images.loader = "custom" and images.loaderFile in your Next.js config.
33. Use standard next/image
Use Image as normal.
Key Benefits
- Avoid $10/1000 requests Vercel image transform charges
- Sub-50ms TTFB edge cache worldwide
- Automatic responsive srcset generation
- Full Next.js App Router & Server Components support
Official Developer Documentation
Need Complete Implementation Guides & API Specs?
Explore parameter references, authentication mechanisms, error codes, and local testing instructions in our official Next.js Framework developer guide.
Supercharge Your Next.js Framework Image Pipeline
Experience sub-50ms AVIF and WebP image optimization in your application. Zero setup fee, instant sandbox keys, and unlimited scalability.
