ObjectStoreService
Connect S3 buckets and mount them into sandboxes.
ObjectStoreService manages object stores: named references to your own S3-compatible buckets (AWS S3, MinIO/Ceph, Cloudflare R2, ...). Credentials are project secrets referenced by name — create them first with daytona.secret.set(). A store can be mounted into a sandbox at creation (via objectStoreMounts) or at runtime (via mount()); the sandbox sees the bucket as a FUSE filesystem. Obtain the service as daytona.objectStore. See the object stores guide.
create()
Creates an object store referencing a bucket and its credential secrets. The store is ready immediately.
| Parameter | Type | Default | Description |
|---|---|---|---|
name | string | — | Store name (unique within the project). |
opts.bucket | string | — | Bucket name. |
opts.accessKeySecret | string | — | Name of the project secret holding the access key — not the value. |
opts.secretKeySecret | string | — | Name of the project secret holding the secret key. |
opts.endpoint | string | — | Custom S3 endpoint (MinIO, R2, ...). |
opts.region | string | — | Bucket region. |
opts.prefix | string | — | Key prefix to scope the mount to. |
opts.pathStyle | boolean | false | Use path-style addressing (typical for MinIO/Ceph). |
opts.readOnly | boolean | false | Default mounts to read-only. |
opts.provider | 'AWS' | 'Minio' | 'Ceph' | 'Cloudflare' | 'Other' | — | Provider hint. |
opts.sessionTokenSecret | string | — | Name of a secret holding a session token, for temporary credentials. |
Returns: the ObjectStore DTO (id, name, bucket, state, ...; credential fields expose only secret names, never values).
Note: The directory-listing cache TTL (
dir_cache_secs) can currently only be set through the REST API — it is not exposed in the SDKs yet.
get()
Fetches an object store by id or name.
Throws: DaytonaNotFoundError if it does not exist.
list()
Lists the project's object stores. Deleted stores are excluded unless includeDeleted is true.
delete()
Deletes an object store. Accepts an ObjectStore DTO (its id is used) or a plain id/name string. Fails with a conflict while a live sandbox has it mounted.
Throws: DaytonaConflictError if the store is mounted by a live sandbox.
Runtime mounts
Mount and unmount stores on a running sandbox without recreating it. See mounting object stores.
mount()
Mounts an object store into a running sandbox at mountPath.
| Parameter | Type | Default | Description |
|---|---|---|---|
sandboxId | string | — | Target sandbox id. |
objectStore | string | — | Store id or name. |
mountPath | string | — | Absolute in-sandbox mount path. |
readOnly | boolean | — | Override the store's default read-only for this mount. |
unmount()
Unmounts a mount by name from a running sandbox.
listMounts()
Lists a sandbox's current object-store mounts.
Returns: the list of mount records.
Mounting at creation: ObjectStoreMount
Attach stores at sandbox creation with ObjectStoreMount objects in objectStoreMounts:
| Field | Type | Default | Description |
|---|---|---|---|
objectStore | string | — | Store id or name (resolved server-side). |
mountPath | string | — | Absolute in-sandbox mount path. |
readOnly | boolean | — | Override the store's default read-only for this mount. |