Spronta

SDKs & Libraries

Official client SDKs

Type-safe libraries for JavaScript, React, and Next.js. Built on a zero-dependency core that works everywhere.

npm install @spronta/images

@spronta/images

Core SDK — URL builder, signing, blurhash, srcset generation

npm install @spronta/images
Runtime: Browser, Node.js, Deno, Bun, WorkersDeps: Zero dependencies
import { Spronta } from "@spronta/images";

const spronta = new Spronta({
  baseUrl: "https://cdn.spronta.com",
  project: "my-project",
  defaults: { format: "auto", quality: "medium" },
});

// Simple URL
spronta.url("photo.jpg", { width: 800, gravity: "face" });

// Responsive srcset
spronta.srcset("hero.jpg", { widths: [640, 1280, 1920] });

// Signed URL (with expiration)
await spronta.signedUrl("photo.jpg", { width: 800 }, 3600);

// Cloudinary-style path URL
spronta.pathUrl("photo.jpg", { width: 800, format: "webp" });
// → /my-project/w_800,f_webp/photo.jpg
Type-safe transform options
URL builder (query params + path-based)
HMAC-SHA256 URL signing
Responsive srcset generation
BlurHash decode + CSS helpers
Config defaults + presets

@spronta/images-react

React components with blurhash placeholders and lazy loading

npm install @spronta/images-react
Runtime: React 18+Deps: @spronta/images
import { SprontaProvider, SprontaImage } from "@spronta/images-react";

// Wrap your app once
<SprontaProvider client={spronta}>
  <App />
</SprontaProvider>

// Use anywhere — automatic srcset, blurhash, lazy loading
<SprontaImage
  path="hero.jpg"
  alt="Hero image"
  transforms={{ gravity: "auto", format: "webp" }}
  widths={[640, 1280, 1920]}
  blurhash="LEHV6nWB2yk8pyo0adR*.7kCMdnj"
  width={1920}
  height={1080}
/>
<SprontaImage> with automatic srcset
BlurHash canvas placeholder with fade-in
Context provider (configure once)
useSpronta() hook for custom usage
Lazy loading by default
SSR-compatible

@spronta/images-next

Next.js integration — custom image loader and components

npm install @spronta/images-next
Runtime: Next.js 14+Deps: @spronta/images
// Option 1: Drop-in component
import { SprontaNextImage } from "@spronta/images-next";

<SprontaNextImage
  config={sprontaConfig}
  path="hero.jpg"
  alt="Hero"
  width={1920}
  height={1080}
  blurhash="LEHV6nWB2yk8pyo0adR*"
  priority
/>

// Option 2: Custom loader for next/image
// spronta-loader.ts
import { createSprontaLoader } from "@spronta/images-next";

export default createSprontaLoader({
  baseUrl: "https://cdn.spronta.com",
  project: "my-project",
  defaults: { quality: "medium" },
});
next/image custom loader
<SprontaNextImage> component
BlurhHash blur placeholder
Automatic format negotiation
Priority / fill mode support
App Router + Pages Router

More SDKs coming

PHP, Python, Ruby, Go, and .NET SDKs are on the roadmap. In the meantime, the REST API and URL-based CDN work with any language. The URL builder is ~100 lines in any language.

PHPPythonRubyGo.NETSwift

Start building

Free plan includes 1,000 images and 5GB bandwidth.