Skip to content

Allow SDK to auto initializeApp when hosted on Firebase #23

Closed
@justweb1

Description

@justweb1

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Issue:

  1. Currently when hosted on Firebase a user has to load component scripts in the correct order (auth, database, app)
  2. Then they need to call '/__/firebase/init.js'

These steps do not play well with polymerfire or angularfire. The user still needs to declare the config properties either directly or by setting up their own secrets.

Request:

  1. Add a test to check if app is hosted on Firebase.
var _isFirebaseHosted = fetch('/__/firebase/init.js').then(response => {
  if (response.status == 200) {
    return true;
  }
  return false;
});
  1. Auto initializeApp
if (_isFirebaseHosted) {
 firebase.initializeApp('/__/firebase/init.js');
}

@mbleigh @jshcrowthe

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions