# colis with Wasabi

> Deliver files to your clients from a Wasabi bucket with colis: the createBucket() configuration, the CLI starter, and what to know about this provider.

Canonical: https://colis-site.vercel.app/en/providers/wasabi · Markdown: https://colis-site.vercel.app/en/providers/wasabi.md · Français: https://colis-site.vercel.app/providers/wasabi

S3-compatible, on a regional endpoint.

**createBucket()**
```ts
import { createBucket } from '@colis/core'

const store = createBucket({
  bucket: 'transfers',
  region: 'eu-central-1',
  endpoint: 'https://s3.eu-central-1.wasabisys.com',
  credentials: {
    accessKeyId: process.env.WASABI_ACCESS_KEY!,
    secretAccessKey: process.env.WASABI_SECRET_KEY!,
  },
})
```

## Why this one
Wasabi is S3-compatible and reached through a regional endpoint. It works with colis like any other endpoint-based provider: set the endpoint and the region, and hand it a key pair.

## A starter configuration, and what is left to do.
init writes the file with ${VAR} references rather than secrets, so it is meant to be committed; the env file it points at is not.

```sh
colis init --provider wasabi --bucket transfers
```
**colis.config.json**
```json
{
  "bucket": "transfers",
  "region": "eu-central-1",
  "endpoint": "https://s3.eu-central-1.wasabisys.com",
  "prefix": "transfers",
  "expiresIn": "24h",
  "envFile": ".env",
  "credentials": {
    "accessKeyId": "${WASABI_ACCESS_KEY}",
    "secretAccessKey": "${WASABI_SECRET_KEY}"
  }
}
```

### Then
1. Put WASABI_ACCESS_KEY and WASABI_SECRET_KEY in .env.
2. Add a lifecycle rule on the prefix.
3. Run `colis verifier`. It performs the operations colis needs and reports what happened.

## Notes on Wasabi.
- **Read the storage terms** — How long a deleted object is still billed depends on the provider’s terms. Parcels are short-lived by design, so check them before you rely on short lifetimes.
- **Expiry cleanup** — The expiry stops a parcel being handed over; only a lifecycle rule deletes the object. Give the prefix a rule that expires objects after a day or two, and colis verifier turns green.

[The full guide](https://colis-docs.vercel.app/docs/stockages)
