@streamby/core is a robust, plug-and-play middleware framework designed for integrating storage-agnostic media management capabilities into existing Express.js (or compatible) applications. Currently at version `0.26.10`, the package provides functionality for file uploads, listings, and multi-project access across various storage providers like AWS S3, with planned support for Google Cloud Storage, Cloudflare R2, and local servers. It aims for a rapid, minor version release cadence, indicating active development and feature enhancements. A key differentiator is its architectural approach: it operates as a library within your existing API, eliminating the need to deploy and manage a separate backend service for media handling. This design promotes tight integration and simplifies deployment, offering a flexible solution for developers building scalable media-centric applications who require fine-grained control over their backend stack and data.
npm install streamby-coreVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up an Express server with StreamBy core middleware, integrating an S3 storage provider, dummy authentication, and a WebSocket server for real-time capabilities. Requires `ws` and `@types/ws`.
Wrap your Express `app` instance with `http.createServer(app)` and pass the resulting `server` object to both `server.listen()` and the `WebSocketServer({ server })` constructor.At application startup, before any StreamBy operations, explicitly call the appropriate setup function: `setupStreambyPg({ pool, schema: 'streamby' })` for PostgreSQL or `setupStreambyMongo({ client, dbName: 'streamby' })` for MongoDB.Ensure `http.createServer(app)` is used to create the server, and this `server` object is passed to both `server.listen()` and the `WebSocketServer({ server })` constructor.Run the appropriate database schema setup function (`setupStreambyPg` for PostgreSQL or `setupStreambyMongo` for MongoDB) at your application's initialization phase, providing a connected database client/pool.