[null,null,["最后更新时间 (UTC):2025-08-16。"],[],[],null,["To provide maximum flexibility, Firebase Remote Config supports both\nclient-side and server-side SDK integrations for web applications. This means\nyour app can:\n\n- **Fetch and evaluate Remote Config templates on your server:** Your server can download the Remote Config template and evaluate targeting conditions directly.\n- **Optimize initial page load performance:** For server-side rendering scenarios, the server can provide the evaluated configuration to the client during the initial page load. This improves performance by delivering the necessary configuration data upfront.\n\n| **Important:** The focus of this capability is on the server-side evaluation. Client-side evaluation is not supported.\n\nThis approach empowers you to manage your app's behavior and configuration\ndynamically, particularly in server-side rendering setups.\n\nSet up server-side rendering for your apps\n\nTo configure server-side rendering with Remote Config in your web app,\nupdate your client and server apps using the steps that follow.\n\nStep 1: Update your server-side application\n\nIn your server app, where you implemented the Firebase Admin Node.js\nSDK, include a `RemoteConfigFetchResponse` class that accepts the existing\n[`ServerConfig`](https://github.com/firebase/firebase-admin-node/blob/a6a930c0cec994f61ca1f4d2f75a5c74144e19e4/src/remote-config/remote-config-api.ts#L685)\n. You can use this to serialize config values that can be passed to your client. \n\n\n export default async function MyServerComponent() {\n const serverApp = initializeApp();\n const serverSideConfig = getRemoteConfig(serverApp);\n const template = await serverSideConfig.getServerTemplate();\n const config = template.evaluate({randomizationId: 'some-uuid'});\n const fetchResponse = new RemoteConfigFetchResponse(serverApp, config);\n\n return (\n \u003cdiv\u003e\n \u003cMyClientComponent initialFetchResponse={fetchResponse}\u003e\u003c/MyClientComponent\u003e\n \u003c/div\u003e\n );\n }\n\nStep 2: Update your client app\n\nOn your client app, which implements the Firebase Javascript SDK, include an\n`initialFetchResponse` configuration option to accept the serialized values\npassed from your server app. This manually hydrates the config state without\nmaking an async fetch request.\n\nAdditionally, you must include an initialization option that lets you set the\n`firebase-server` as the `templateId` on the client SDK. This configures the SDK\nto use the initial server-side template for subsequent fetches, ensuring\nconsistent parameters and conditional values between client and server. \n\n\n export default function MyClientComponent({initialFetchResponse= ''} = {}) {\n const app = initializeApp(firebaseConfig);\n const config = getRemoteConfig(app, {\n templateId: 'firebase-server',\n initialFetchResponse\n });\n const paramValue = getString(config, 'my_rc_parameter_key');\n\n return (\n \u003cdiv\u003e{paramValue}\u003c/div\u003e\n );\n }"]]