---
title: Tencent Cloud Object Storage
description: Tencent Cloud Object Storage (COS) via the S3-compatible API. Endpoint derived from the region code; bucket name must include the -<appid> suffix.
peerDeps:
  - "@aws-sdk/client-s3"
  - "@aws-sdk/s3-presigned-post"
  - "@aws-sdk/s3-request-presigner"
---

## 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.

```package-install
files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presigner
```

## Usage

```ts lineNumbers
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

<AutoTypeTable
  path="../../packages/files-sdk/src/tencent/index.ts"
  name="TencentAdapterOptions"
/>

## Compatibility

| Method            | Status | Notes |
| ----------------- | :----: | ----- |
| `upload`          |   ✅   |       |
| `download`        |   ✅   |       |
| `delete`          |   ✅   |       |
| `list`            |   ✅   |       |
| `search`          |   ✅   |       |
| `head`            |   ✅   |       |
| `exists`          |   ✅   |       |
| `copy`            |   ✅   |       |
| `url`             |   ✅   |       |
| `signedUploadUrl` |   ✅   |       |
