Skip to content
Files SDK
Esc
navigateopen⌘Jpreview
On this page

Exoscale Object Storage

Exoscale Object Storage (SOS) via the S3-compatible API. Endpoint derived from the zone code (ch-gva-2, de-fra-1, ...).

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-presigner
pnpm add files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presigner
yarn add files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presigner
bun add files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presigner

Usage

import { Files } from "files-sdk";
import { exoscale } from "files-sdk/exoscale";

const files = new Files({
  adapter: exoscale({
    bucket: "uploads",
    region: "ch-gva-2", // or "de-fra-1", "at-vie-1", "bg-sof-1", ...
    // accessKeyId / secretAccessKey auto-loaded from
    // EXOSCALE_API_KEY / EXOSCALE_API_SECRET
  }),
});

Exoscale Object Storage (SOS) via its S3-compatible API. A thin wrapper around the S3 adapter - endpoint derived from the zone code (ch-gva-2, ch-dk-2, de-fra-1, de-muc-1, at-vie-1, at-vie-2, bg-sof-1), virtual-hosted-style addressing, errors relabelled. Pass the zone as region - Exoscale calls them zones but they fill the SigV4 region slot. Auto-loads from EXOSCALE_API_KEY and EXOSCALE_API_SECRET. Generate IAM keys in the Exoscale Portal under IAM -> API Keys.

Options

PropType
bucketstring

Exoscale bucket name. The adapter scopes all operations to it.

Typestring
regionstring

Exoscale zone code (Exoscale calls these zones rather than regions), e.g. `"ch-gva-2"` (Geneva), `"ch-dk-2"` (Zurich), `"de-fra-1"` (Frankfurt), `"de-muc-1"` (Munich), `"at-vie-1"` / `"at-vie-2"` (Vienna), `"bg-sof-1"` (Sofia). Drives the endpoint host (`https://sos-<region>.exo.io`); there's no env-var fallback. Doubles as the SigV4 region.

Typestring
endpoint?string

Override the Exoscale endpoint. When unset, defaults to `https://sos-${region}.exo.io`. SOS routes by Host header — the SDK prepends the bucket subdomain for virtual-hosted style.

Typestring
accessKeyId?string

Static credentials. Falls back to `EXOSCALE_API_KEY`; required if that env var isn't set.

Typestring
secretAccessKey?string

Static credentials. Falls back to `EXOSCALE_API_SECRET`; required if that env var isn't set.

Typestring
forcePathStyle?boolean

Use path-style addressing (`/<bucket>/<key>`) rather than virtual-hosted style. Defaults to `false` — virtual-hosted is canonical for SOS.

Typeboolean
publicBaseUrl?string

Origin used to build URLs from `url()`. When set, `url(key)` returns `${publicBaseUrl}/${key}` and skips signing. For public buckets the natural value is `https://sos-${region}.exo.io/${bucket}` (path-style) or `https://${bucket}.sos-${region}.exo.io`; a custom CNAME fronting the bucket also works. When unset, `url()` falls back to a presigned GetObject (default expiry: 1 hour).

Typestring
defaultUrlExpiresIn?number

Default expiry, in seconds, for the presigned URLs returned by `url()` when `publicBaseUrl` is not set. Defaults to 3600 (1 hour).

Typenumber

Compatibility

Method Status Notes
upload
download
delete
list
search
head
exists
copy
url
signedUploadUrl

Was this page helpful?