Back to changelog
Changelog

SDK 2.0: Zero Dependencies, Native Fetch, and Smarter Media Uploads

Cosmic's avatar

Cosmic

April 7, 2026

SDK 2.0: Zero Dependencies, Native Fetch, and Smarter Media Uploads - cover image

The has been rebuilt from the inside out. Version 2.0 removes all runtime dependencies, replaces axios with the native API, and adds automatic MIME type detection for media uploads. The public API is unchanged — upgrade with confidence.


Zero Runtime Dependencies

The SDK no longer ships with or . Every HTTP request now goes through the native , , and APIs built into Node.js 18+ and all modern browsers.

  • Before: 2 runtime dependencies (, ) plus 7 transitive packages
  • After: 0 runtime dependencies
  • Result: Smaller , faster installs, reduced supply chain surface area

Native Fetch

All request handling has been rewritten to use the Fetch API. This means the SDK works identically in Node.js, Bun, Deno, Cloudflare Workers, and the browser without polyfills or adapters.


Automatic MIME Type Detection for Media Uploads

Media uploads now automatically detect the correct MIME type from the filename. Previously, uploads without an explicit were sent as , which could cause issues with image processing and CDN optimization.

The SDK recognizes 25+ file types out of the box — images, video, audio, documents, fonts, and more.


Batch Operations

Also new since 1.8: the method lets you create, update, and delete multiple objects in a single API call. Each operation succeeds or fails independently.


Breaking Changes

Node.js 18+ is required. The native API was added in Node.js 18.0. If you're on an older version, stay on .

That's the only breaking change. The entire public API — objects, media, object types, object revisions, and AI — is fully backward compatible.

Upgrade


Full Changelog

VersionChange
2.0.1Automatic MIME type detection for media uploads
2.0.0Replace and with native , , and . Zero runtime dependencies. Requires Node.js >= 18.
1.9.0Add method for bulk create, update, and delete operations

Read the docs: API Reference, SDK on npm

Ready to get started?

Build your next project with Cosmic and start creating content faster.

No credit card required • 75,000+ developers