react-azure-config
Version:
🚀 The Ultimate Multi-App Configuration Library! CRITICAL BUG FIXES: Prefixed environment keys no longer sent to Azure. Complete architectural redesign with bulletproof fallback system. Enterprise-grade Azure integration and monorepo support.
86 lines • 2.6 kB
TypeScript
import type { ReactNode } from 'react';
type ReactPlugin = any;
type ApplicationInsights = any;
type IConfiguration = any;
export interface AppInsightsConfig {
connectionString?: string;
autoInitialize?: boolean;
enableReactPlugin?: boolean;
enableAutoRouteTracking?: boolean;
enableCookiesUsage?: boolean;
enableRequestHeaderTracking?: boolean;
enableResponseHeaderTracking?: boolean;
additionalConfig?: Partial<IConfiguration>;
}
export interface AppInsightsContextValue {
appInsights: ApplicationInsights | null;
reactPlugin: ReactPlugin | null;
isInitialized: boolean;
config: AppInsightsConfig | null;
error: string | null;
connectionString: string | null;
}
export interface CustomEventData {
name: string;
properties?: {
[key: string]: any;
};
measurements?: {
[key: string]: number;
};
}
export interface CustomExceptionData {
exception: Error;
severityLevel?: number;
properties?: {
[key: string]: any;
};
measurements?: {
[key: string]: number;
};
}
export interface PageViewData {
name?: string;
url?: string;
properties?: {
[key: string]: any;
};
measurements?: {
[key: string]: number;
};
}
export interface AppInsightsProviderProps {
children: ReactNode;
config?: AppInsightsConfig;
connectionString?: string;
}
export interface TelemetryContext {
userId?: string;
sessionId?: string;
appVersion?: string;
environment?: string;
properties?: {
[key: string]: any;
};
}
export interface UseAppInsightsReturn {
appInsights: ApplicationInsights | null;
trackEvent: (event: CustomEventData) => void;
trackException: (exception: CustomExceptionData) => void;
trackPageView: (pageView?: PageViewData) => void;
trackMetric: (name: string, value: number, properties?: {
[key: string]: any;
}) => void;
setContext: (context: TelemetryContext) => void;
isReady: boolean;
connectionString: string | null;
}
export declare const APP_INSIGHTS_CONFIG_KEYS: {
readonly CONNECTION_STRING: "ApplicationInsights:ConnectionString";
readonly ENABLE_AUTO_ROUTE_TRACKING: "ApplicationInsights:EnableAutoRouteTracking";
readonly ENABLE_COOKIES_USAGE: "ApplicationInsights:EnableCookiesUsage";
readonly ENABLE_REQUEST_HEADER_TRACKING: "ApplicationInsights:EnableRequestHeaderTracking";
readonly ENABLE_RESPONSE_HEADER_TRACKING: "ApplicationInsights:EnableResponseHeaderTracking";
};
export {};
//# sourceMappingURL=types.d.ts.map