Data Storage
storage
Cloud storage and file management
storage
Cloud storage for files, documents, and assets with versioning, access control, and seamless integration with CDN delivery.
Overview
The storage primitive provides S3-compatible object storage for all file types with features like versioning, metadata, access control, and automatic CDN distribution.
Quick Example
import { storage } from 'sdk.do'
// Upload file
const file = await storage.upload('./document.pdf', {
path: '/documents/contracts/agreement.pdf',
metadata: {
category: 'legal',
confidential: true,
},
})
// Download file
const buffer = await storage.download(file.path)
// List files
const files = await storage.list('/documents', {
recursive: true,
filter: { extension: 'pdf' },
})
// Get public URL
const url = storage.publicUrl(file.path, {
expires: '1h',
})Core Capabilities
- File Upload/Download - Store and retrieve any file type
- Versioning - Track file versions and history
- Access Control - Fine-grained permissions and signed URLs
- Metadata - Custom metadata and tagging
- CDN Integration - Automatic edge caching and delivery
Access Methods
SDK
TypeScript/JavaScript library for storage operations
await storage.upload('./document.pdf', { path: '/documents/agreement.pdf' })CLI
Command-line tool for file management
do storage upload document.pdf --path /documents/agreement.pdfAPI
REST/RPC endpoints for storage operations
curl -X POST https://api.do/v1/storage/upload -F "[email protected]"MCP
Model Context Protocol for AI-driven storage operations
Upload document.pdf to /documents/agreement.pdf with metadata category: legal