← Back to all posts
7 min readCentrali Team

Centrali 2.2.0: Real-time Events, Image Transformation, and Enhanced Compute

Our biggest release yet brings real-time subscriptions, on-the-fly image transformation, file storage from compute functions, and enterprise-grade security hardening.

ProductAnnouncementChangelog

Centrali 2.2.0 is here, and it's packed with features that make building modern applications faster and more powerful.

This release focuses on three themes: real-time capabilities, media processing, and compute function power-ups. Let's dive into what's new.

Real-time Events

You can now subscribe to record changes and receive instant updates as data changes in your workspace. No more polling, no WebSocket infrastructure to manage.

typescript
const subscription = centrali.realtime.subscribe({ structures: ['order'], events: ['record_created', 'record_updated'], onEvent: (event) => { console.log('Order changed:', event.recordId); updateUI(event.data); } });

Key features:

  • Filter by structure, event type, and data values using Centrali Filter Language (CFL)
  • Automatic reconnection with exponential backoff
  • 1-hour connection timeout with automatic reconnect hints
  • Available in the SDK for JavaScript/TypeScript

This is perfect for live dashboards, collaborative apps, and cache invalidation.

Image Resize & Compression

Stop storing multiple versions of the same image. Centrali now transforms images on-the-fly when you request them.

bash
# Original image GET /render/abc123 # Resize to 200px width (maintains aspect ratio) GET /render/abc123?width=200 # Compress JPEG to 60% quality GET /render/abc123?format=jpeg&quality=60 # Convert PNG to WebP for smaller files GET /render/abc123?format=webp

Supported operations:

  • Resize by width, height, or both (fits within bounds)
  • Quality adjustment for JPEG output (1-100)
  • Format conversion: JPEG, PNG, WebP
  • Works with JPEG, PNG, WebP, GIF, BMP, and TIFF inputs

Use this for responsive images, thumbnails, and bandwidth optimization.

Compute Function Power-ups

We added several new APIs to make compute functions more powerful:

File Storage

Store binary files directly from your functions:

typescript
const result = await api.storeFile( pdfBase64Content, "shipping-label.pdf", { mimeType: "application/pdf", encoding: "base64" } ); // result.fileUrl = URL to download the file // result.renderId = ID for the render endpoint

This is perfect for storing generated PDFs, downloaded images, and API response files.

Crypto API

Hash and sign data without external dependencies:

typescript
// SHA256 hash const hash = api.crypto.sha256('data-to-hash'); // HMAC-SHA256 signature const signature = api.crypto.hmacSha256('secret-key', 'data-to-sign'); // With base64 key (for Azure Communication Services, etc.) const azureSignature = api.crypto.hmacSha256( accessKey, stringToSign, { keyEncoding: 'base64' } );

Base64 Utilities

Encode and decode Base64 for webhooks and API integrations:

typescript
const encoded = api.base64.encode("Hello, World!"); const decoded = api.base64.decode("SGVsbG8sIFdvcmxkIQ=="); // Common use: Basic Auth headers const authHeader = `Basic ${api.base64.encode(`${user}:${pass}`)}`;

Error Logging

Structured error logging with automatic context:

typescript
api.logError({ message: 'Payment processing failed', orderId: order.id, error: error.message, stack: error.stack });

Security Hardening

We've significantly improved the security posture of compute functions:

  • Execution timeout prevents runaway functions from consuming resources
  • Network policies isolate compute pods from internal infrastructure
  • Domain allowlist validation prevents SSRF attacks
  • Restricted math.evaluate() to safe arithmetic only
  • File-based secrets replace environment variables
  • Pod security context with non-root execution

Console UI Improvements

The console got a refresh too:

  • Deleted structures tab with restore and permanent delete
  • Bulk delete for structures, records, and other resources
  • Redesigned IAM pages for login, logout, and workspace selection
  • View Run button for easier access to function execution details
  • Quick interval presets for scheduled triggers (1 week, 1 month)
  • Better error messages throughout the UI

API Documentation Portal

We added interactive OpenAPI documentation for all services. Browse endpoints, see request/response schemas, and try APIs directly from the docs.

Breaking Changes

None! This release is fully backward compatible.

What's Next

We're working on more storage features (signed URLs, CDN caching), expanded real-time capabilities, and function versioning. Stay tuned.

Get Started

Update your SDK to the latest version:

bash
npm install @centrali/sdk@latest

Check the changelog for the complete list of changes, and visit docs.centrali.io for detailed documentation.

Building something with Centrali and want to share feedback about this feature?

Email feedback@centrali.io