index.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*! firebase-admin v12.1.1 */
  2. "use strict";
  3. /*!
  4. * @license
  5. * Copyright 2017 Google Inc.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License");
  8. * you may not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. const firebase = require("./default-namespace");
  20. // Only Node.js has a process variable that is of [[Class]] process
  21. const processGlobal = typeof process !== 'undefined' ? process : 0;
  22. if (Object.prototype.toString.call(processGlobal) !== '[object process]') {
  23. const message = `
  24. ======== WARNING! ========
  25. firebase-admin appears to have been installed in an unsupported environment.
  26. This package should only be used in server-side or backend Node.js environments,
  27. and should not be used in web browsers or other client-side environments.
  28. Use the Firebase JS SDK for client-side Firebase integrations:
  29. https://firebase.google.com/docs/web/setup
  30. `;
  31. // tslint:disable-next-line:no-console
  32. console.error(message);
  33. }
  34. module.exports = firebase;