The Firebase JS SDK is now in BETA!
This EAP site is no longer maintained. See the official Firebase Documentation site for the latest documentation and information about the Firebase JS SDK.

Home > @firebase/storage

storage package

Cloud Storage for Firebase

Functions

Function Description
deleteObject(ref) Deletes the object at this location.
getDownloadURL(ref) Returns the download URL for the given Reference.
getMetadata(ref) A promise that resolves with the metadata for this object. If this object doesn't exist or metadata cannot be retreived, the promise is rejected.
getStorage(app, bucketUrl) Gets a Firebase StorageService instance for the given Firebase app.
list(ref, options) List items (files) and prefixes (folders) under this storage reference.List API is only available for Firebase Rules Version 2.GCS is a key-blob store. Firebase Storage imposes the semantic of '/' delimited folder structure. Refer to GCS's List API if you want to learn more.To adhere to Firebase Rules's Semantics, Firebase Storage does not support objects whose paths end with "/" or contain two consecutive "/"s. Firebase Storage List API will filter these unsupported objects. list() may fail if there are too many unsupported objects in the bucket.
listAll(ref) List all items (files) and prefixes (folders) under this storage reference.This is a helper method for calling list() repeatedly until there are no more results. The default pagination size is 1000.Note: The results may not be consistent if objects are changed while this operation is running.Warning: listAll may potentially consume too many resources if there are too many results.
ref(storage, url) Returns a StorageReference for the given url.
ref(storageOrRef, path) Returns a StorageReference for the given path in the default bucket.
updateMetadata(ref, metadata) Updates the metadata for this object.
uploadBytes(ref, data, metadata) Uploads data to this object's location. The upload is not resumable.
uploadBytesResumable(ref, data, metadata) Uploads data to this object's location. The upload can be paused and resumed, and exposes progress updates.
uploadString(ref, value, format, metadata) Uploads a string to this object's location. The upload is not resumable.
useStorageEmulator(storage, host, port) Modify this StorageService instance to communicate with the Cloud Storage emulator.

Interfaces

Interface Description
FirebaseStorageError An error returned by the Firebase Storage SDK.
FullMetadata The full set of object metadata, including read-only properties.
ListOptions The options list() accepts.
ListResult Result returned by list().
SettableMetadata Object metadata that can be set at any time.
StorageObserver A stream observer for Firebase Storage.
StorageReference Represents a reference to a Google Cloud Storage object. Developers can upload, download, and delete objects, as well as get/set object metadata.
StorageService A Firebase Storage instance.
UploadMetadata Object metadata that can be set at upload.
UploadResult Result returned from a non-resumable upload.
UploadTask Represents the process of uploading an object. Allows you to monitor and manage the upload.
UploadTaskSnapshot Holds data about the current state of the upload task.

Variables

Variable Description
StringFormat An enumeration of the possible string formats for upload.

Type Aliases

Type Alias Description
StringFormat An enumeration of the possible string formats for upload.
TaskEvent An event that is triggered on a task.
TaskState Represents the current state of a running upload.