The Firebase Storage service interface.

Do not call this constructor directly. Instead, use firebase.storage().

See Get Started on Web for a full guide on how to use the Firebase Storage service.

Index

Properties

app

app: App

The app associated with the Storage service instance.

example
var app = storage.app;

maxOperationRetryTime

maxOperationRetryTime: number

The maximum time to retry operations other than uploads or downloads in milliseconds.

maxUploadRetryTime

maxUploadRetryTime: number

The maximum time to retry uploads in milliseconds.

Methods

ref

  • ref ( path ? :  string ) : Reference
  • Returns a reference for the given path in the default bucket.

    Parameters

    • Optional path: string

      A relative path to initialize the reference with, for example path/to/image.jpg. If not passed, the returned reference points to the bucket root.

    Returns Reference

    A reference for the given path.

refFromURL

  • refFromURL ( url string ) : Reference
  • Returns a reference for the given absolute URL.

    Parameters

    • url: string

      A URL in the form:
      1) a gs:// URL, for example gs://bucket/files/image.png
      2) a download URL taken from object metadata.

    Returns Reference

    A reference for the given URL.

setMaxOperationRetryTime

setMaxUploadRetryTime

useEmulator

  • useEmulator ( host string ,  port number ,  options ? :  { mockUserToken ?: EmulatorMockTokenOptions | string } ) : void
  • Modify this Storage instance to communicate with the Cloud Storage emulator.

    Parameters

    • host: string

      The emulator host (ex: localhost)

    • port: number

      The emulator port (ex: 5001)

    • Optional options: { mockUserToken?: EmulatorMockTokenOptions | string }

    Returns void