返回 Skill 列表
extension
分类: 开发与工程无需 API Key

chrono-storage

ChronoAI平台S3对象存储集成,适用于已部署的应用。在通过HTTP API在ChronoAI上部署的应用中实现文件上传功能时使用。涵盖上传API、CDN访问模式、错误处理以及特定框架的实现(React、Vue、原生JS)。

person作者: jakexiaohubgithub

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