Skip to content

0.1.0

Compare
Choose a tag to compare
@Archish27 Archish27 released this 09 Feb 08:48
· 43 commits to main since this release
ed3b34d

Release Notes

Version 0.1.0

Features

  1. 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.
  2. 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)