# Use the S3 API with a Resilis bucket

Source: https://resilis.io/docs/object-storage/s3-api/

Resilis buckets answer signed S3 requests, so the S3 library your app already uses can talk to them. This page shows the endpoint settings, a client example and the operations you can rely on.

## Endpoint and addressing

Use the S3 endpoint the dashboard shows for your bucket, and use path-style addressing. Path-style means the bucket name goes in the URL path instead of in the hostname, which most SDKs call forcePathStyle. The dashboard storage overview labels the endpoint as an S3 API with path-style addressing.

Set the region to the value the credential drawer shows. Sign requests with the access key and secret you issued for the bucket. The secret is used exactly as shown.

## Set up an S3 client

This is an example for the AWS SDK for JavaScript v3 (@aws-sdk/client-s3). The variable names are your choice.

### Example: TypeScript with @aws-sdk/client-s3

```ts
import { S3Client } from '@aws-sdk/client-s3';

export const s3 = new S3Client({
  endpoint: process.env.STORAGE_ENDPOINT,
  region: process.env.STORAGE_REGION,
  forcePathStyle: true,
  credentials: {
    accessKeyId: process.env.STORAGE_ACCESS_KEY_ID!,
    secretAccessKey: process.env.STORAGE_SECRET_ACCESS_KEY!,
  },
});
```

## Supported operations

The endpoint accepts these S3 operations. Test any other S3 feature with disposable data before you depend on it.

- List the buckets your credential can reach.
- Check that a bucket exists (head bucket).
- List objects in a bucket (ListObjectsV2), with a prefix and delimiter.
- Get an object and read its metadata (head object).
- Put an object.
- Delete an object.
- Multipart uploads: create, upload a part, list parts, complete and abort.

## If an upload fails over checksum parameters

If your SDK version adds checksum parameters that your upload rejects, create the S3 client with the requestChecksumCalculation option set to WHEN_REQUIRED.

## Is it S3-compatible, and will my S3 library work?

Managed object storage uses an S3-compatible backend, and the endpoint accepts signed S3 requests. It lists buckets and objects, reads, writes and deletes objects, and handles multipart uploads. Requests can be signed in the request headers or in the URL, so presigned URLs work.

Point your client at the Resilis endpoint, give it a bucket credential, and turn on path-style addressing. Test the operations your app relies on with disposable data first, and check any S3 feature outside those listed before depending on it.

- [Upload from the browser with presigned URLs](/docs/object-storage/presigned-uploads/)
- [Create a bucket and credentials](/docs/object-storage/buckets/)
