npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@appdynamics/react-native-agent

v24.7.0

Published

Native instrumentation of iOS and android apps built with react-native.

Downloads

10,398

Readme

AppDynamics agent for react-native

Brings full support for the AppDynamics mobile RUM (Real User Monitoring) to react-native applications.

What does this module do?

This module injects the native AppDynamics agents into your application and offers a JavaScript bridge to the Instrumentation management interface.

Setup

Requirements

React Native version 0.6 or above.

(iOS only): Pod target and Xcode deployment target must both be >=11. Find the pod target version in the Podfile located in <your_react_native_app>/ios/.

Step 0: Eject your app

Make sure your app is "ejected". The agent needs a proper application to instrument. It won't work in expo!
See ReactNative Eject Explained for more info.

Step 1: Install the npm package

npm install --save @appdynamics/react-native-agent

Step 2: Instrument your application

node node_modules/@appdynamics/react-native-agent/bin/cli.js install

The command above will modify your build configuration to enable build-time instrumentation of your app. It assumes you've kept the default project structure created with the react-native cli tools. This command may fail if you have made heavy modifications to your android and iOS projects. If so, please refer to the manual installation section of this manual.

Step 3: (android only) Add permissions

Add the following permissions to your app's AndroidManifest.xml (which should be located under android/app/src/main/).

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.your.application">

    // Add the following:
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

    // ...
</manifest>

ℹ️ We need these permissions to allow the agent to limit its activity when resources are scarce.

Usage

First, log into your AppDynamics account, and create a new mobile application. Chose either Android or iOS, it doesn't matter. You will obtain an application key which you will need for the next step.

Start the agent like so:

import {Instrumentation} from '@appdynamics/react-native-agent';

Instrumentation.start({
  appKey: 'YOUR-APP-KEY-HERE',
});

info: You should initialize the agent as soon as possible, ideally in your index.js file.

ℹ️ use_frameworks!

If you are using use_frameworks!, you will also need to add $toggleADEUMRNStaticFramework = true in your Podfile:

// Podfile
platform :ios, '11.0'

$toggleADEUMRNStaticFramework = true

target 'MyApp' do
    use_frameworks!
    // ...
end

Documentation

Read the full API documentation here to learn how to customize the instrumentation.

Manual installation

Most users don't have to do these steps. In most cases, you can use the CLI as described in the setup section. If that didn't work, then follow these steps.

For android, add the following line to your android/build.gradle:

apply from: '../node_modules/@appdynamics/react-native-agent/android/adeum.gradle'

Make sure the file settings.gradle contains a reference to the appdynamics agent module as shown below. This is should have been added automatically when autolinking.

include ':@appdynamics_react-native-agent'
project(':@appdynamics_react-native-agent').projectDir = new File(rootProject.projectDir, '../node_modules/@appdynamics/react-native-agent/android')

Also, android/app/build.gradle should contain a reference to the appdynamics agent module.

dependencies {
    implementation project(':@appdynamics_react-native-agent')
    // ...
}

For iOS, link the appdynamics agent module like any other native module. Read about manual linking here.