Skip to content

Commit a2d24b3

Browse files
authored
Merge a73e3aa into 01ca9df
2 parents 01ca9df + a73e3aa commit a2d24b3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs-devsite/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ https://github.com/firebase/firebase-js-sdk
1919
| [@firebase/app](./app.md#app_package) | Firebase App |
2020
| [@firebase/app-check](./app-check.md#app-check_package) | The Firebase App Check Web SDK. |
2121
| [@firebase/auth](./auth.md#auth_package) | Firebase Authentication |
22+
| [@firebase/data-connect](./data-connect.md#data-connect_package) | Firebase Data Connect |
2223
| [@firebase/database](./database.md#database_package) | Firebase Realtime Database |
2324
| [@firebase/firestore](./firestore.md#firestore_package) | Cloud Firestore |
2425
| [@firebase/functions](./functions.md#functions_package) | Cloud Functions for Firebase |

packages/data-connect/src/network/fetch.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@
1616
*/
1717

1818
import { Code, DataConnectError } from '../core/error';
19+
import { SDK_VERSION } from '../core/version';
1920
import { logDebug, logError } from '../logger';
2021

2122
let connectFetch: typeof fetch | null = globalThis.fetch;
2223
export function initializeFetch(fetchImpl: typeof fetch) {
2324
connectFetch = fetchImpl;
2425
}
26+
function getGoogApiClientValue(): string {
27+
return 'gl-js/ fire/' + SDK_VERSION;
28+
}
2529
export function dcFetch<T, U>(
2630
url: string,
2731
body: U,
@@ -32,7 +36,8 @@ export function dcFetch<T, U>(
3236
throw new DataConnectError(Code.OTHER, 'No Fetch Implementation detected!');
3337
}
3438
const headers: HeadersInit = {
35-
'Content-Type': 'application/json'
39+
'Content-Type': 'application/json',
40+
'X-Goog-Api-Client': getGoogApiClientValue()
3641
};
3742
if (accessToken) {
3843
headers['X-Firebase-Auth-Token'] = accessToken;

0 commit comments

Comments
 (0)