File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Platform } from 'react-native' ;
22import type { DetourEvent } from '../types' ;
3+ import { SDK_HEADER_VALUE } from '../../version' ;
34
45const EVENT_API_URL = 'https://godetour.dev/api/analytics/event' ;
56
@@ -21,6 +22,7 @@ export const sendEvent = async ({
2122 'Content-Type' : 'application/json' ,
2223 'Authorization' : `Bearer ${ apiKey } ` ,
2324 'X-App-ID' : appID ,
25+ 'X-SDK' : SDK_HEADER_VALUE ,
2426 } ,
2527 body : JSON . stringify ( {
2628 event_name : event . eventName ,
Original file line number Diff line number Diff line change 11import { Platform } from 'react-native' ;
2+ import { SDK_HEADER_VALUE } from '../../version' ;
23
34const RETENTION_API_URL = 'https://godetour.dev/api/analytics/retention' ;
45
@@ -20,6 +21,7 @@ export const sendRetentionEvent = async ({
2021 'Content-Type' : 'application/json' ,
2122 'Authorization' : `Bearer ${ apiKey } ` ,
2223 'X-App-ID' : appID ,
24+ 'X-SDK' : SDK_HEADER_VALUE ,
2325 } ,
2426 body : JSON . stringify ( {
2527 event_name : eventName ,
Original file line number Diff line number Diff line change 11import type { RequiredConfig } from '../types' ;
2+ import { SDK_HEADER_VALUE } from '../../version' ;
23import {
34 getDeterministicFingerprint ,
45 getProbabilisticFingerprint ,
@@ -24,6 +25,7 @@ const sendFingerprint = async ({
2425 'Content-Type' : 'application/json' ,
2526 'Authorization' : `Bearer ${ API_KEY } ` ,
2627 'X-App-ID' : appID ,
28+ 'X-SDK' : SDK_HEADER_VALUE ,
2729 } ,
2830 body : JSON . stringify ( requestBody ) ,
2931 } ) ;
Original file line number Diff line number Diff line change 11import type { RequiredConfig } from '../types' ;
2+ import { SDK_HEADER_VALUE } from '../../version' ;
23
34const API_URL = 'https://godetour.dev/api/link/resolve-short' ;
45
@@ -22,6 +23,7 @@ export const resolveShortLink = async ({
2223 'Content-Type' : 'application/json' ,
2324 'Authorization' : `Bearer ${ API_KEY } ` ,
2425 'X-App-ID' : appID ,
26+ 'X-SDK' : SDK_HEADER_VALUE ,
2527 } ,
2628 body : JSON . stringify ( { url } ) ,
2729 } ) ;
Original file line number Diff line number Diff line change 1+ import { version } from '../package.json' ;
2+
3+ export const SDK_HEADER_VALUE = `react-native/${ version } ` ;
You can’t perform that action at this time.
0 commit comments