UNPKG

1.4 kBJavaScriptView Raw
1/*! firebase-admin v12.0.0 */
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 */
19const firebase = require("./default-namespace");
20// Only Node.js has a process variable that is of [[Class]] process
21const processGlobal = typeof process !== 'undefined' ? process : 0;
22if (Object.prototype.toString.call(processGlobal) !== '[object process]') {
23 const message = `
24======== WARNING! ========
25
26firebase-admin appears to have been installed in an unsupported environment.
27This package should only be used in server-side or backend Node.js environments,
28and should not be used in web browsers or other client-side environments.
29
30Use the Firebase JS SDK for client-side Firebase integrations:
31
32https://firebase.google.com/docs/web/setup
33`;
34 // tslint:disable-next-line:no-console
35 console.error(message);
36}
37module.exports = firebase;