Releases: middleware-labs/middleware-react-native
Releases · middleware-labs/middleware-react-native
1.0.7
1.0.6
Release v1.0.6
1.0.5
Release v1.0.5
1.0.4
Release v1.0.4
1.0.3
Release v1.0.3
1.0.2
Release v1.0.2
1.0.1
Release v1.0.1
1.0.0
Release v1.0.0
0.2.0
Release v0.2.0
0.1.0
Release Notes
Version 0.1.0
Features
-
AutoInstrumentation
- Added HTTP Monitoring.
- Implemented JS Errors auto-instrumentation.
- Added navigation tracking for
react-navigation
. - Introduced native crash error auto-instrumentation.
- Added support for custom instrumentation using OpenTelemetry.
- Implemented custom logging capabilities.
-
RUM Session Tracking
- Introduced RUM (Real User Monitoring) Session Tracking.
Documentation
- Updated documentation for AutoInstrumentation, Custom Instrumentation, RUM Session Tracking, and more.
Compatibility & Requirements
- Middleware React Native for Mobile now supports React Native version 0.68 and higher.
- The library is compatible with the following frameworks and libraries:
- Expo framework.
- React Navigation 5 and 6.
Installation
To use the latest features and improvements, make sure to update the library:
yarn add @middleware.io/middleware-react-native@latest
Usage
import { MiddlewareWrapper, type ReactNativeConfiguration } from '@middleware.io/middleware-react-native';
const MiddlewareConfig: ReactNativeConfiguration = {
serviceName: 'Mobile-SDK-ReactNative',
projectName: '$Mobile-SDK-ReactNative',
accountKey: '<middleware-account-key>',
target: '<target-url>',
deploymentEnvironment: 'PROD',
globalAttributes: {
name: '<your-name>',
},
};
export default function App() {
return (
<MiddlewareWrapper configuration={MiddlewareConfig}>
{/* Application Components */}
</MiddlewareWrapper>
);
}
Custom Logging
You can now add custom logs such as debug, error, warn, and info. These logs will be shown on the Middleware Logs Dashboard:
MiddlewareRum.debug("I am debug");
MiddlewareRum.error("I am error");
MiddlewareRum.info("I am info");
MiddlewareRum.warn("I am warn");
Setting Global Attributes
Global attributes can be set using the setGlobalAttributes
function:
MiddlewareRum.setGlobalAttributes({
"name": "Middleware",
"app.version": "1.0.0",
"custom_key": "some value"
});
Reporting Custom Errors
Handled errors, exceptions, and messages can be reported using the reportError
function:
try {
throw new Error("I am error")
} catch (err) {
MiddlewareRum.reportError(err);
}
Updating Location Information
Latitude and longitude can now be set as global attributes for location information:
MiddlewareRum.updateLocation(latitude: number, longitude: number)