No server

By default, the module provides a storage server that is abstracted by useS3Object composable. In some cases where no server is needed, it can be excluded by setting server config option to false. As a result, the built-in composables and endpoints are no longer available and the Unstorage instance can directly be used.

The drivers of the Unstorage instance are defined on s3 mount point and therefore can be referenced via useStorage('s3').

Note that the drivers can either be s3 or fs and are configured via driver config option.

The s3 driver supports the following methods

  • getItem/getItemRaw To retrieve KV or Binary data respectively. Note that the internal response headers can be retrieved from headers option.
  • setItem/setItemRaw To upload KV or Binary data respectively. Note that the internal request headers can be extended by headers option. On setItemRaw it's recommended to set Content-Length and Content-Type headers as they may not be automatically resolved by the provider.
  • removeItem To delete a single Object.
  • clear To delete multiple Objects.
  • getMeta To retrieve the user-defined metadata. Note that setMeta is not supported because metadata can only be set on upload (setItem/setItemRaw) via meta option.
  • getKeys Gets the keys of objects in a specific folder.
  • hasItem Checks if the object exists.