<body>
<!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services -->
<!-- Firebase App (the core Firebase SDK) is always required and must be listed first -->
<script src="/__/firebase/8.10.1/firebase-app.js"></script>
<!-- Add Firebase products that you want to use -->
<script src="/__/firebase/8.10.1/firebase-auth.js"></script>
<script src="/__/firebase/8.10.1/firebase-firestore.js"></script>
</body>
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["\u003cbr /\u003e\n\nFirebase Hosting reserves URLs in your site beginning with `/__`. This\nreserved namespace makes it easier to use other Firebase products together with\nFirebase Hosting.\n\nThese reserved URLs are available both when you deploy to Firebase\n(`firebase deploy`) or when you run your app on a local server\n(`firebase serve`).\n\nAdd scripts for reserved URLs\n\nBecause Firebase Hosting is served over HTTP/2 when deployed, you can boost\nperformance by loading files from the same origin. Firebase Hosting serves\nversion 8 of the Firebase JavaScript SDK from special URLs formatted like so: \n\n```\n/__/firebase/JS_SDK_VERSION/FIREBASE_SDK_NAME.js\n```\n\nWe strongly recommend loading only the [libraries](#libraries_hosting-urls) that\nyou use in your app. For example, to include only Authentication and\nCloud Firestore, add the following scripts to the bottom of your `\u003cbody\u003e`\ntag, but before you use any Firebase services: \n\n \u003cbody\u003e\n \u003c!-- Insert these scripts at the bottom of the HTML, but before you use any Firebase services --\u003e\n \u003c!-- Firebase App (the core Firebase SDK) is always required and must be listed first --\u003e\n \u003cscript src=\"/__/firebase/8.10.1/firebase-app.js\"\u003e\u003c/script\u003e\n\n \u003c!-- Add Firebase products that you want to use --\u003e\n \u003cscript src=\"/__/firebase/8.10.1/firebase-auth.js\"\u003e\u003c/script\u003e\n \u003cscript src=\"/__/firebase/8.10.1/firebase-firestore.js\"\u003e\u003c/script\u003e\n \u003c/body\u003e\n\nSDK auto-configuration\n\nAutomatic SDK configuration makes it easy to manage multiple environments (such\nas dev, staging, and production) from a single codebase. By relying on the\nreserved Hosting URL, you can deploy the same code to multiple Firebase\nprojects.\n\nIn addition to hosting the SDKs themselves, the reserved namespace also provides\nall of the configuration necessary to initialize the SDK for the Firebase\nproject associated with the Hosting site. This Firebase configuration and\nSDK initialization is provided by a script that you can include directly: \n\n \u003c!-- Load the Firebase SDKs before loading this file --\u003e\n \u003cscript src=\"/__/firebase/init.js\"\u003e\u003c/script\u003e\n\nWhen you deploy to Firebase or test your app locally, this script automatically\nconfigures the Firebase JavaScript SDK for the\n[active Firebase project](/docs/cli#project_aliases) and initializes the SDK.\n\nIf you prefer to control initialization yourself, the Firebase configuration\nvalues are also available in JSON form: \n\n fetch('/__/firebase/init.json').then(async response =\u003e {\n firebase.initializeApp(await response.json());\n });\n\nAvailable Firebase JS SDKs (from reserved Hosting URLs) Reserved Hosting URLs are available only with version 8 and earlier. You cannot use version 9 or later with Hosting URLs.\n\n| **Firebase product** | **Library reference (reserved URL)** |\n|---------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Firebase core (required) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-app.js\"\u003e\u003c/script\u003e ``` |\n| [Analytics](/docs/analytics/get-started?platform=web) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-analytics.js\"\u003e\u003c/script\u003e ``` |\n| [App Check](/docs/app-check) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-app-check.js\"\u003e\u003c/script\u003e ``` |\n| [Authentication](/docs/auth/web/start) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-auth.js\"\u003e\u003c/script\u003e ``` |\n| [Cloud Firestore](/docs/firestore/quickstart) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-firestore.js\"\u003e\u003c/script\u003e ``` |\n| [Cloud Functions for Firebase Client SDK](/docs/functions/callable#call_the_function) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-functions.js\"\u003e\u003c/script\u003e ``` |\n| [Firebase installations](/docs/projects/manage-installations) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-installations.js\"\u003e\u003c/script\u003e ``` |\n| [Cloud Messaging](/docs/cloud-messaging/js/client) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-messaging.js\"\u003e\u003c/script\u003e ``` For an optimal experience using Cloud Messaging, also add the Firebase SDK for Analytics. |\n| [Cloud Storage](/docs/storage/web/start) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-storage.js\"\u003e\u003c/script\u003e ``` |\n| [Performance Monitoring](/docs/perf-mon/get-started-web) *(**beta** release)* | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-performance.js\"\u003e\u003c/script\u003e ``` |\n| [Realtime Database](/docs/database/web/start) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-database.js\"\u003e\u003c/script\u003e ``` |\n| [Remote Config](/docs/remote-config/use-config-web) *(**beta** release)* | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase-remote-config.js\"\u003e\u003c/script\u003e ``` For an optimal experience using Remote Config, also add the Firebase SDK for Analytics. |\n| Firebase JavaScript SDK (entire SDK) | ```scdoc \u003cscript src=\"/__/firebase/8.10.1/firebase.js\"\u003e\u003c/script\u003e ``` |\n\nAuth helpers\n\n[Firebase Authentication](https://firebase.google.com/docs/auth/) uses the reserved\nnamespace to provide special JavaScript and HTML to complete authentication with\nproviders via OAuth. This allows each Firebase project to have a unique\nFirebase subdomain, increasing the security of Firebase Authentication.\n\nIn addition, this allows you to use your own custom domain for the `authDomain`\noption of `firebase.initializeApp()`. If you\n[configure a custom domain](https://firebase.google.com/docs/hosting/custom-domain)\nfor Firebase Hosting, then you can also specify that custom domain (instead\nof your `web.app` or `firebaseapp.com` subdomain) when initializing the Firebase\nSDKs. See\n[Best practices for using signInWithRedirect](/docs/auth/web/redirect-best-practices#update-authdomain)\nfor more details on using a custom domain.\n\nReserved URLs and service workers\n\nIf you are building a Progressive Web App (PWA), you might create a service\nworker that has a \"navigation fallback\" and renders a specific URL by default\nif it doesn't match a list of precached items.\n| You must disable any fallbacks for the \\`/__\\` namespace in order for Firebase Hosting to function properly.\n\nIf you're using the [sw-precache](https://github.com/GoogleChrome/sw-precache)\nlibrary, you can add a navigation fallback whitelist setting that excludes the\nreserved namespace: \n\n {\n navigateFallbackWhitelist: [/^(?!\\/__).*/]\n }\n\nIn general, just remember that the double-underscore namespace is reserved for\nFirebase usage and that you should not intercept these requests in your service\nworker."]]