Tencent Cloud Object Storage
Tencent Cloud Object Storage (COS) via the S3-compatible API. Endpoint derived from the region code; bucket name must include the -<appid> suffix.
Installation
@aws-sdk/client-s3, @aws-sdk/s3-presigned-post, and @aws-sdk/s3-request-presigner are optional peer dependencies of files-sdk - install alongside the SDK so the adapter’s imports resolve at runtime.
npm install files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presignerpnpm add files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presigneryarn add files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presignerbun add files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presignerUsage
import { Files } from "files-sdk";
import { tencent } from "files-sdk/tencent";
const files = new Files({
adapter: tencent({
bucket: "uploads-1250000000", // <name>-<appid>
region: "ap-guangzhou", // or "ap-shanghai", "na-siliconvalley", ...
// accessKeyId / secretAccessKey auto-loaded from
// TENCENT_SECRET_ID / TENCENT_SECRET_KEY
}),
});
Tencent Cloud Object Storage (COS) via its S3-compatible API. A thin wrapper around the S3 adapter - endpoint derived from the region code (ap-guangzhou, ap-shanghai, na-siliconvalley, …), virtual-hosted-style addressing, errors relabelled. Auto-loads from TENCENT_SECRET_ID and TENCENT_SECRET_KEY. Generate API keys in the Tencent Cloud console under Cloud Access Management -> API Keys.
Options
TencentAdapterOptions: Cannot read properties of undefined (reading 'ESNext')Compatibility
| Method | Status | Notes |
|---|---|---|
upload |
✅ | |
download |
✅ | |
delete |
✅ | |
list |
✅ | |
search |
✅ | |
head |
✅ | |
exists |
✅ | |
copy |
✅ | |
url |
✅ | |
signedUploadUrl |
✅ |