Skip to content

Began reporting client sdk information #8271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs-devsite/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ https://github.com/firebase/firebase-js-sdk
| [@firebase/app](./app.md#app_package) | Firebase App |
| [@firebase/app-check](./app-check.md#app-check_package) | The Firebase App Check Web SDK. |
| [@firebase/auth](./auth.md#auth_package) | Firebase Authentication |
| [@firebase/data-connect](./data-connect.md#data-connect_package) | Firebase Data Connect |
Copy link
Collaborator

@markarndt markarndt May 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is docs-devsite/data-connect.md in another branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's in this branch I believe

| [@firebase/database](./database.md#database_package) | Firebase Realtime Database |
| [@firebase/firestore](./firestore.md#firestore_package) | Cloud Firestore |
| [@firebase/functions](./functions.md#functions_package) | Cloud Functions for Firebase |
Expand Down
7 changes: 6 additions & 1 deletion packages/data-connect/src/network/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
*/

import { Code, DataConnectError } from '../core/error';
import { SDK_VERSION } from '../core/version';
import { logDebug, logError } from '../logger';

let connectFetch: typeof fetch | null = globalThis.fetch;
export function initializeFetch(fetchImpl: typeof fetch) {

Check failure on line 23 in packages/data-connect/src/network/fetch.ts

View workflow job for this annotation

GitHub Actions / Lint

Missing return type on function
connectFetch = fetchImpl;
}
function getGoogApiClientValue(): string {
return 'gl-js/ fire/' + SDK_VERSION;
}
export function dcFetch<T, U>(

Check failure on line 29 in packages/data-connect/src/network/fetch.ts

View workflow job for this annotation

GitHub Actions / Lint

Missing return type on function
url: string,
body: U,
{ signal }: AbortController,
Expand All @@ -32,7 +36,8 @@
throw new DataConnectError(Code.OTHER, 'No Fetch Implementation detected!');
}
const headers: HeadersInit = {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'X-Goog-Api-Client': getGoogApiClientValue()
};
if (accessToken) {
headers['X-Firebase-Auth-Token'] = accessToken;
Expand Down
Loading