Storage through the Jupiter client
The aggregate Jupiter client exposes Storage through client.storage. It supplies the project ID and the current authentication token to every Storage request.
import { Jupiter } from '@jupiter-cloud/sdk' const client = new Jupiter( 'https://api.jupitercloud.co', 'project-id', 'optional-team-api-key')Available operations
- Create, inspect, update, flush, and delete buckets
- Upload, list, download, copy, and delete objects
- Read object metadata and replace object attributes
- Filter object listings by key prefix and paginate with cursors
- Upload large objects in multiple parts
- Copy an existing object into a multipart upload
- Cancel requests with an AbortSignal
Handle results
Every Storage method returns a result containing data, error, and the underlying Response. Check error before reading data. Service errors and client-side network, timeout, abort, HTTP, and invalid-response errors use the same result shape.
const result = await client.storage.listBuckets() if (result.error) { console.error(result.error.code) console.error(result.error.detail) throw result.error} console.log(result.data.buckets)console.log(result.response.status)Storage locations
Select a location when creating a bucket. The currently exported location codes are apac, eeur, enam, oc, weur, and wnam.