Bare React Native app demonstrating the EDOT SDK with no navigation library — every API is exercised in a single scrollable screen, so you can copy snippets straight out of the source.
-
Copy the environment file and fill in your values:
cp .env.example .env
-
Install dependencies from the monorepo root:
yarn install
-
Install iOS pods (macOS only):
cd ios && pod install && cd ..
-
Run the app:
# iOS yarn ios # Android yarn android
Initialization lives in src/App.tsx. To change the SDK config in your own app, edit the useEdot({...}) call inside InitializedApp:
import { EdotErrorBoundary, useEdot } from '@inoxth/react-native-edot-sdk';
function InitializedApp() {
const { ready, error } = useEdot({
serverUrl: EDOT_SERVER_URL,
ios: { serviceName: EDOT_SERVICE_NAME_IOS },
android: { serviceName: EDOT_SERVICE_NAME_ANDROID },
serviceVersion: EDOT_SERVICE_VERSION,
deploymentEnvironment: EDOT_DEPLOYMENT_ENVIRONMENT,
secretToken: EDOT_SECRET_TOKEN,
});
if (error) return <Text>Telemetry unavailable: {error.message}</Text>;
if (!ready) return <ActivityIndicator />;
return (
<EdotErrorBoundary fallback={<Text>Something went wrong</Text>}>
{/* sections live under src/sections/ */}
</EdotErrorBoundary>
);
}Because there is no navigation library, EdotNavigationProvider is not used here. View-level spans must be emitted manually if you want them.
Once useEdot(...) resolves, uncaught JS errors and unhandled promise rejections are reported automatically. Wrap React subtrees with EdotErrorBoundary to also report render-time errors and show a fallback UI:
import { EdotErrorBoundary } from '@inoxth/react-native-edot-sdk';
<EdotErrorBoundary fallback={<Text>Something went wrong</Text>}>
<YourComponent />
</EdotErrorBoundary>A live demo lives in src/sections/ErrorsSection.tsx — it triggers a JS error, a rejected promise, and a render crash inside an EdotErrorBoundary.
Use EdotReactNative.log(severity, message, attributes?) to send structured logs at any severity:
import { EdotReactNative } from '@inoxth/react-native-edot-sdk';
EdotReactNative.log('info', 'User signed in', { 'user.id': '42' });
EdotReactNative.log('warn', 'Slow network detected');
EdotReactNative.log('error', 'Payment failed', { 'error.code': '402' });Severities: trace, debug, info, warn, error, fatal. Attribute values must be string | number | boolean. See src/sections/LogsSection.tsx for a working demo.
Each section under src/sections/ is a self-contained example of one SDK surface:
StatusSection—EdotReactNative.getCurrentSessionIdNetworkSection— auto-instrumentedfetch/ XHRTracingSection—getTracerProvider().getTracer().startSpan(),withSpanContextMetricsSection—getMeterProvider()withcreateCounter,createHistogram,createUpDownCounterLogsSection—EdotReactNative.logat every severityInteractionSection—useEdotActionhook andwithEdotTrackingHOCErrorsSection— JS errors, promise rejections,EdotErrorBoundarycrashes