azbrand-s3
v1.0.2
Published
Official TypeScript & Node.js SDK for AZBrand zero-egress S3-compatible cloud object storage.
Maintainers
Readme
AZBrand S3 Cloud Storage SDK
Official Node.js and TypeScript client for AZBrand S3 Cloud Object Storage.
Store, stream, and distribute media, backups, and large files globally with zero egress bandwidth fees and 100% S3 compatibility.
Features
- Zero Egress Fees: Download unlimited bandwidth without surprise hyperscaler invoices.
- Direct Presigned S3 PUT: Upload gigabyte-sized files directly to the storage edge.
- Bucket Management: Create Private Vaults (AES-256), Public CDN Buckets, and Multi-Tenant Shared Workspaces.
- Time-Expiring Share Links: Generate signed temporary URLs or permanent public links in one call.
- TypeScript First: Fully typed request and response models.
Installation
Install using npm: npm install azbrand-s3
Quick Start
Generate your API Access Keys from your AZBrand Storage Dashboard.
Example usage in TypeScript or JavaScript:
import { AZBrandStorage } from "azbrand-s3";
const storage = new AZBrandStorage({ accessKeyId: process.env.AZ_ACCESS_KEY_ID, secretAccessKey: process.env.AZ_SECRET_ACCESS_KEY, });
// 1. Upload a File const file = await storage.files.upload({ bucket: "my-backups", file: "./database.sql.gz", fileName: "database.sql.gz", contentType: "application/gzip", });
console.log("Uploaded File:", file.r2_storage_path);
// 2. List Files in Bucket const files = await storage.files.list({ bucket: "my-backups" }); console.log("Bucket Files:", files);
// 3. Get Signed 1-Hour Download Link const downloadUrl = await storage.files.getDownloadUrl(file.id); console.log("Download URL:", downloadUrl);
API Reference
Buckets
- storage.buckets.list() - List all buckets (Private, Public CDN, and Shared).
- storage.buckets.create({ name, type }) - Create an S3 storage bucket.
- storage.buckets.delete(bucketId) - Permanently delete a bucket and its contents.
Files
- storage.files.upload({ bucket, file, fileName, contentType }) - Upload via direct S3 signed PUT.
- storage.files.list({ bucket, query }) - Query files with prefix filtering.
- storage.files.getDownloadUrl(fileId) - Generate temporary signed S3 download URL.
- storage.files.getMetadata(fileId) - Inspect size, ETag, and Content-Type (HEAD).
- storage.files.copy({ sourceFileId, targetBucketId, newFileName }) - Fast S3 server-side copy.
- storage.files.delete(fileId) - Permanently delete a storage object.
- storage.files.share({ fileId, isPublic, expiresInDays }) - Create public share link.
Usage
- storage.usage.get() - Check storage quota and Class A/B request metrics.
Links & Resources
License
MIT (c) AZBrand Canada
