Vultr Object Storage
Vultr Object Storage via the S3-compatible API. Endpoint derived from the region code (ewr, sjc, ams, blr, ...).
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 { vultr } from "files-sdk/vultr";
const files = new Files({
adapter: vultr({
bucket: "uploads",
region: "ewr", // or "sjc", "ams", "blr", "del", "sgp", "lux"
// accessKeyId / secretAccessKey auto-loaded from
// VULTR_ACCESS_KEY_ID / VULTR_SECRET_ACCESS_KEY
}),
});
Vultr Object Storage via its S3-compatible API. A thin wrapper around the S3 adapter - endpoint derived from the region code (ewr, sjc, ams, blr, del, sgp, lux), virtual-hosted-style addressing, errors relabelled. Auto-loads from VULTR_ACCESS_KEY_ID and VULTR_SECRET_ACCESS_KEY. Generate access keys in the Vultr customer portal under Object Storage -> your subscription -> Overview.
Options
bucketstring
Vultr bucket name. The adapter scopes all operations to it.
stringregionstring
Vultr Object Storage region code, e.g. `"ewr"` (New Jersey), `"sjc"` (Silicon Valley), `"ams"` (Amsterdam), `"blr"` (Bangalore), `"del"` (Delhi), `"sgp"` (Singapore), `"lux"` (Luxembourg). Drives the endpoint host (`https://<region>.vultrobjects.com`); there's no env-var fallback. Doubles as the SigV4 region.
stringendpoint?string
Override the Vultr endpoint. When unset, defaults to `https://${region}.vultrobjects.com`. Vultr routes by Host header — the SDK prepends the bucket subdomain for virtual-hosted style.
stringaccessKeyId?string
Static access key ID. Falls back to `VULTR_ACCESS_KEY_ID`; required if that env var isn't set.
stringsecretAccessKey?string
Static secret access key. Falls back to `VULTR_SECRET_ACCESS_KEY`; required if that env var isn't set.
stringforcePathStyle?boolean
Use path-style addressing (`/<bucket>/<key>`) rather than virtual-hosted style. Defaults to `false` — virtual-hosted is canonical for Vultr.
booleanpublicBaseUrl?string
Origin used to build URLs from `url()`. When set, `url(key)` returns `${publicBaseUrl}/${key}` and skips signing. For buckets with public ACL, the natural value is `https://${bucket}.${region}.vultrobjects.com`; a custom CNAME fronting the bucket also works. Vultr has no built-in CDN. When unset, `url()` falls back to a presigned GetObject (default expiry: 1 hour).
stringdefaultUrlExpiresIn?number
Default expiry, in seconds, for the presigned URLs returned by `url()` when `publicBaseUrl` is not set. Defaults to 3600 (1 hour).
numberCompatibility
| Method | Status | Notes |
|---|---|---|
upload |
✅ | |
download |
✅ | |
delete |
✅ | |
list |
✅ | |
search |
✅ | |
head |
✅ | |
exists |
✅ | |
copy |
✅ | |
url |
✅ | |
signedUploadUrl |
✅ |