fix(mobile): Fix diagnostics-client API — use DiagnosticsClient.getInstance()
@bytelyst/diagnostics-client exports DiagnosticsClient class with singleton getInstance(config), not a createDiagnosticsClient factory. Fixed import and initialization with correct config shape.
This commit is contained in:
parent
c2d641433f
commit
0b5c224075
@ -2,7 +2,7 @@ import { createTelemetryClient } from '@bytelyst/telemetry-client';
|
||||
import { createFeatureFlagClient } from '@bytelyst/feature-flag-client';
|
||||
import { createKillSwitchClient } from '@bytelyst/kill-switch-client';
|
||||
import { createBlobClient } from '@bytelyst/blob-client';
|
||||
import { createDiagnosticsClient } from '@bytelyst/diagnostics-client';
|
||||
import { DiagnosticsClient } from '@bytelyst/diagnostics-client';
|
||||
import { API_CONFIG, PRODUCT_ID } from '../api/config';
|
||||
import { mmkvStorage } from '../store/mmkv-storage';
|
||||
|
||||
@ -42,12 +42,20 @@ export const blobClient = createBlobClient({
|
||||
getAccessToken,
|
||||
});
|
||||
|
||||
export const diagnosticsClient = createDiagnosticsClient({
|
||||
baseUrl: API_CONFIG.platformBaseUrl,
|
||||
export function getDiagnosticsClient() {
|
||||
return DiagnosticsClient.getInstance({
|
||||
productId: PRODUCT_ID,
|
||||
serverUrl: API_CONFIG.platformBaseUrl,
|
||||
platform: 'mobile',
|
||||
getAccessToken,
|
||||
});
|
||||
channel: 'notelett_mobile',
|
||||
anonymousInstallId: mmkvStorage.getItem(`${PRODUCT_ID}_install_id`) ?? 'unknown',
|
||||
osFamily: 'other',
|
||||
appVersion: '0.1.0',
|
||||
buildNumber: '1',
|
||||
releaseChannel: 'dev',
|
||||
getAuthToken: () => getAccessToken() ?? '',
|
||||
});
|
||||
}
|
||||
|
||||
let platformInitialized = false;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user