Skip to main content

Storage Buckets

Store unlimited files, images, videos, and other assets with global CDN distribution for fast access worldwide.

What are Storage Buckets?

Storage Buckets provide unlimited object storage for your applications. Files are automatically distributed via CDN to 200+ edge locations worldwide for optimal performance.

Key Features

  • Unlimited Storage: No storage limits
  • Global CDN: Automatic CDN distribution
  • High Availability: Multi-zone replication
  • Versioning: Keep file version history
  • Access Control: Public and private buckets
  • Encryption: AES-256 encryption at rest
  • S3-Compatible: Use standard S3 API
  • Automatic Optimization: Image compression and format conversion

Use Cases

  • User Uploads: Store user-uploaded files
  • Static Assets: Host images, CSS, JavaScript
  • Media: Store videos, audio files
  • Backups: Archive backup files
  • CDN: Serve content globally
  • AI Data: Store model weights and datasets

Getting Started

  1. Create a Storage Bucket from your dashboard
  2. Configure access (public or private)
  3. Upload files via dashboard or API
  4. Get CDN URL for public access
  5. Connect your application

Uploading Files

Dashboard

  1. Navigate to your bucket
  2. Click “Upload Files”
  3. Select files or drag and drop
  4. Files are automatically uploaded

API

const formData = new FormData();
formData.append('file', file);

const response = await fetch('https://api.antryk.com/v1/storage/upload', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${API_KEY}`
  },
  body: formData
});

SDK

const antryk = require('@antryk/storage');

// Upload file
const file = await antryk.storage.upload({
  bucket: 'my-bucket',
  file: fs.readFileSync('photo.jpg'),
  filename: 'photo.jpg',
  contentType: 'image/jpeg'
});

// Get public URL
const url = antryk.storage.getPublicUrl(file.key);

CDN URLs

Access files via CDN:
https://cdn.antryk.com/bucket-name/file.jpg
  • Automatic HTTPS: All files served over HTTPS
  • HTTP/2: Faster delivery with HTTP/2
  • Compression: Automatic gzip compression
  • Cache Headers: Configurable cache control

Access Control

Configure bucket access:
  • Public: Files accessible via CDN URL
  • Private: Require signed URLs for access
  • CORS: Configure cross-origin resource sharing
  • Policy: Set bucket policies for fine-grained control

File Operations

List Files

const files = await antryk.storage.listFiles({
  bucket: 'my-bucket',
  prefix: 'images/',
  limit: 100
});

Delete Files

await antryk.storage.deleteFile({
  bucket: 'my-bucket',
  key: 'file.jpg'
});

Get Signed URL

const url = await antryk.storage.getSignedUrl({
  bucket: 'my-bucket',
  key: 'private-file.jpg',
  expiresIn: 3600 // 1 hour
});

Versioning

Enable versioning to keep file history:
await antryk.storage.enableVersioning({
  bucket: 'my-bucket'
});

// Retrieve old version
const oldVersion = await antryk.storage.getFileVersion({
  bucket: 'my-bucket',
  key: 'file.jpg',
  versionId: 'old-version-id'
});

Image Optimization

Automatic image optimization:
  • WebP Conversion: Convert to WebP format
  • Compression: Automatic compression
  • Resizing: On-the-fly resizing
  • Format Detection: Automatic format optimization
Access optimized images:
https://cdn.antryk.com/bucket-name/image.jpg?w=800&h=600&q=80

Lifecycle Policies

Automate file management:
await antryk.storage.setLifecyclePolicy({
  bucket: 'my-bucket',
  rules: [
    {
      id: 'delete-old-files',
      prefix: 'temp/',
      expiration: 30 // days
    }
  ]
});

Pricing

Storage Buckets are billed by:
  • Storage: Data stored per GB/month
  • Bandwidth: CDN data transfer
  • Requests: API requests
  • Operations: PUT, GET, DELETE operations

Monitoring

Track storage usage:
  • Storage Size: Total data stored
  • Bandwidth: CDN data transfer
  • Requests: API request counts
  • Object Count: Number of files

Create Storage Bucket

Get started with storage buckets