File tree 2 files changed +7
-1
lines changed
packages/data-connect/src/network
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ https://github.com/firebase/firebase-js-sdk
19
19
| [ @firebase/app ] ( ./app.md#app_package ) | Firebase App |
20
20
| [ @firebase/app-check ] ( ./app-check.md#app-check_package ) | The Firebase App Check Web SDK. |
21
21
| [ @firebase/auth ] ( ./auth.md#auth_package ) | Firebase Authentication |
22
+ | [ @firebase/data-connect ] ( ./data-connect.md#data-connect_package ) | Firebase Data Connect |
22
23
| [ @firebase/database ] ( ./database.md#database_package ) | Firebase Realtime Database |
23
24
| [ @firebase/firestore ] ( ./firestore.md#firestore_package ) | Cloud Firestore |
24
25
| [ @firebase/functions ] ( ./functions.md#functions_package ) | Cloud Functions for Firebase |
Original file line number Diff line number Diff line change 16
16
*/
17
17
18
18
import { Code , DataConnectError } from '../core/error' ;
19
+ import { SDK_VERSION } from '../core/version' ;
19
20
import { logDebug , logError } from '../logger' ;
20
21
21
22
let connectFetch : typeof fetch | null = globalThis . fetch ;
22
23
export function initializeFetch ( fetchImpl : typeof fetch ) {
23
24
connectFetch = fetchImpl ;
24
25
}
26
+ function getGoogApiClientValue ( ) : string {
27
+ return 'gl-js/ fire/' + SDK_VERSION ;
28
+ }
25
29
export function dcFetch < T , U > (
26
30
url : string ,
27
31
body : U ,
@@ -32,7 +36,8 @@ export function dcFetch<T, U>(
32
36
throw new DataConnectError ( Code . OTHER , 'No Fetch Implementation detected!' ) ;
33
37
}
34
38
const headers : HeadersInit = {
35
- 'Content-Type' : 'application/json'
39
+ 'Content-Type' : 'application/json' ,
40
+ 'X-Goog-Api-Client' : getGoogApiClientValue ( )
36
41
} ;
37
42
if ( accessToken ) {
38
43
headers [ 'X-Firebase-Auth-Token' ] = accessToken ;
You can’t perform that action at this time.
0 commit comments