chrono-storage
S3 object storage integration for apps deployed on the ChronoAI developer platform. Upload files via the platform HTTP API and access them through the integrated CDN.
Quick Start
// Upload a file and get the CDN URL
const formData = new FormData();
formData.append('file', fileInput.files[0]);
const response = await fetch(`${process.env.PLATFORM_URL}/api/v1/storage/pipelines/${process.env.PIPELINE_ID}/files`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${process.env.PLATFORM_API_TOKEN}`
},
body: formData
});
const { url, filename, size } = await response.json();
// Use: https://{CHRONO_CDN_URL}/{filename}
Environment Variables
| Variable | Description |
|----------|-------------|
| CHRONO_CDN_URL | App's CDN base URL (includes app name) |
| PIPELINE_ID | Pipeline ID for API calls (24-char hex string) |
| PLATFORM_URL | Platform base URL for API endpoints |
| PLATFORM_API_TOKEN | Pipeline-scoped token for storage API |
Reference Documentation
- Environment Variables - Detailed variable descriptions and security notes
- Upload API - HTTP API endpoint for file uploads with code examples
- CDN Access - URL structure, caching, and image optimization
- Error Handling - Common errors and troubleshooting
Scan to join WeChat group