bytex-sdk
v5.13.2
Published
Official ByteX Cloud SDK with AI (BYOM) support
Downloads
687
Maintainers
Readme
ByteX SDK ⚡
The official SDK for the ByteX Cloud Ecosystem.
ByteX SDK provides a powerful, easy-to-use interface for interacting with ByteX Cloud storage and infrastructure. It supports both Supabase and Firebase backends, enabling a true "Bring Your Own Cloud" (BYOC) experience.
✨ Features
- Multi-Provider: Seamlessly switch between Supabase and Firebase.
- Advanced Encryption: Built-in AES-CTR encryption for secure file storage.
- Streaming Support: Direct streaming for media files (video/audio).
- CDN Integration: Purge and manage global CDN cache.
- Middleware System: Intercept and optimize uploads (e.g., auto-convert to WebP).
- Bulk Operations: Download or export entire projects as ZIP.
📦 Installation
npm install bytex-sdk🚀 Quick Start
import { BytexCloud } from 'bytex-sdk';
// Initialize with your API Key
const bytex = new BytexCloud({
apiKey: 'BTX-USER-XXXXXXXX',
dbProvider: 'supabase' // or 'firebase'
});
// Upload a file
await bytex.upload('hello.txt', 'Hello World');
// Get a streaming URL
const streamUrl = bytex.stream('video.mp4');
// List files
const files = await bytex.listFiles();
console.log(files);🛠 Advanced Usage: Middleware
import { BytexCloud, BytexMiddlewares } from 'bytex-sdk';
const bytex = new BytexCloud({ apiKey: '...' });
// Automatically optimize images to WebP before upload
bytex.use(BytexMiddlewares.imageOptimizer(0.8));
await bytex.upload('photo.jpg', fileData); // Uploads as photo.webp🛡 Security
All storage operations are authenticated via API keys. Data can be encrypted locally using standard or custom encryption keys, ensuring that your storage provider never sees raw data.
📄 License
ISC © ByteX Ecosystem
