reactnative-plugin-appice-apm
v1.2.5
Published
Official libapm SDK for react-native
Downloads
28
Readme
AppiceAPM SDK for React Native
Requirements
react-native >= 0.65.0
Installation and Usage
To install the package and setup your project:
npm install reactnative-plugin-appice-apm
How to use it:
========= Mandatory =======================
const AppiceAPM = require('reactnative-plugin-appice-apm');
const AppICE = require('reactnative-plugin-appice');
AppiceAPM.init({
dsn: 'Put your dsn here',
tracesSampleRate: 0.0,
_experiments: {
profilesSampleRate: 1.0,
},
});
AppICE.getUserId((userID: any) => {
if (userID.length > 0) {
AppiceAPM.setUser({ id: userID });
}
});
AppICE.getDeviceId((deviceID: any) => {
if (deviceID.length > 0) {
AppiceAPM.setContext('device', {
id: deviceID,
});
}
});
============ Optional ============================
// You can use these functions as per your requirements.
AppiceAPM.setTag("myTag", "tag-value");
AppiceAPM.setExtra("myExtra", "extra-value");
AppiceAPM.captureMessage("Hello TestApm!");
AppiceAPM.captureException(Error);
inside android->app->build.gradle
apply from: "../../node_modules/reactnative-plugin-appice-apm/libapm.gradle"
just before
android {
}