Options
All
  • Public
  • Public/Protected
  • All
Menu

AppDynamics agent for react-native - API docs

Real user instrumentation for your react-native application.


This API documentation describes the JavaScript interface exposed by the agent. Installation instructions are provided in the package's README file. More information on AppDynamics Real User Monitoring is available on the documentation website.

Setup

Comprehensive setup instructions are provided in the package's README file.

Usage

The main API entry point for this module is the Instrumentation object. Bring it into scope with:

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

Legal

Copyright 2019 AppDynamics LLC and its affiliates.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

CrashReportSummary

CrashReportSummary: { crashId: string; exceptionName: string; exceptionReason: string; signalCode: string; signalName: string }

Type declaration

  • crashId: string

    Uniquely defines the crash, can be used as key to find full crash report.

  • exceptionName: string

    The exception name, may be null if no exception occured.

  • exceptionReason: string

    The exception's reason, may be null if no exception occured.

  • signalCode: string

    The exception's signal code.

  • signalName: string

    The exception's signal name.

JSONType

JSONType: string

MainMenuState

MainMenuState: ReturnType<typeof initialState>

MyState

MyState: ReturnType<typeof initialState>

ResponseHeaders

ResponseHeaders: {}

Type declaration

SettingsScreenState

SettingsScreenState: ReturnType<typeof initialState>

Variables

Const ANTHRACITE_GRAY

ANTHRACITE_GRAY: "#585E67" = "#585E67"

Const BORDER

BORDER: "#DBDFE2" = SIBERIAN_GRAY

Const CLOUD_GRAY

CLOUD_GRAY: "#F1F3F5" = "#F1F3F5"

Const DARK_VIOLET

DARK_VIOLET: "#5845DB" = "#5845DB"

Const DEEP_SLY_BLUE

DEEP_SLY_BLUE: "#006FF0" = "#006FF0"

Const DEEP_SPACE_GRAY

DEEP_SPACE_GRAY: "#19212B" = "#19212B"

Const ELLIPSIS_CHAR

ELLIPSIS_CHAR: "…" = "…"

Const ERROR

ERROR: "#DF0D00" = VALIDATION_RED

Const EveryFeatureModule

EveryFeatureModule: EveryFeatureModule = NativeModules.appd_everyfeature

Binds the TypeScript application code to the native code of EveryFeature.

Const HOVER

HOVER: "#DBDFE2" = SIBERIAN_GRAY

Const INVERSE_BACKGROUND

INVERSE_BACKGROUND: "#5845DB" = PRIMARY

Const INVERSE_BACKGROUND_HOVER

INVERSE_BACKGROUND_HOVER: "#9D8EFF" = PERIWINKLE

Const INVERSE_MAIN

INVERSE_MAIN: "#fff" = MAIN_BACKGROUND

Const InstrumentationConstants

InstrumentationConstants: InstrumentationConstants = NativeModules.appd_private_Instrumentation

Const InstrumentationModule

InstrumentationModule: InstrumentationModule = NativeModules.appd_private_Instrumentation

Const LILAC_VIOLET

LILAC_VIOLET: "#ECE9FF" = "#ECE9FF"

Const LINK

LINK: "#006FF0" = DEEP_SLY_BLUE

Const LINK_HIGHLIGHT

LINK_HIGHLIGHT: "#BEDFFF" = RAIN_BLUE

Const LOCAL_COLLECTOR_URL

LOCAL_COLLECTOR_URL: "http://10.0.2.2:9001" | "http://localhost:9001" = Platform.OS === 'android' ? 'http://10.0.2.2:9001' : 'http://localhost:9001'

Const MAIN

MAIN: "#19212B" = DEEP_SPACE_GRAY

Const MAIN_BACKGROUND

MAIN_BACKGROUND: "#fff" = "#fff"

Const MATTER_GRAY

MATTER_GRAY: "#A2A6AB" = "#A2A6AB"

Const MAX_ARG_LENGTH

MAX_ARG_LENGTH: 512 = 512

The string representation of function arguments will be truncated to this number of characters.

Const MAX_CLASS_NAME_LENGTH

MAX_CLASS_NAME_LENGTH: 80 = 80

Maximum length for class names returned by

Const NR_BASE_URL_LOCAL

NR_BASE_URL_LOCAL: "http://10.0.2.2:9001" | "http://localhost:9001" = LOCAL_COLLECTOR_URL

Base URL used to make network requests when the application runs in a (presumably automated) local test environment.

Const NR_BASE_URL_REMOTE

NR_BASE_URL_REMOTE: "https://www.appdynamics.com" = "https://www.appdynamics.com"

Base URL used to make network requests when the application runs in a manual "real world" setup.

Const OVERLAY

OVERLAY: "#585E67" = ANTHRACITE_GRAY

Const PATCHES

PATCHES: Patch[] = [{name: 'AppDynamics build plugin link',anchor: /^((\s*\n)*(\/\/.+\n|\/\*[^]*\*\/))*/g, // Place this patch after the first comment block of the filepayload:'\n// Applies the AppDynamics build time instrumentation plugin.\n' +'// This should be placed at the top of your top-level build.gradle file.\n' +"apply from: '../node_modules/@appdynamics/react-native-agent/android/adeum.gradle'\n",target: path.join(process.cwd(), 'android/build.gradle'),},]

Const PERIWINKLE

PERIWINKLE: "#9D8EFF" = "#9D8EFF"

Const PRIMARY

PRIMARY: "#5845DB" = DARK_VIOLET

Const PRIMARY_HOVER

PRIMARY_HOVER: "#9D8EFF" = PERIWINKLE

Const RAIN_BLUE

RAIN_BLUE: "#BEDFFF" = "#BEDFFF"

Const SELECTED

SELECTED: "#ECE9FF" = LILAC_VIOLET

Const SIBERIAN_GRAY

SIBERIAN_GRAY: "#DBDFE2" = "#DBDFE2"

Const SUCCESS

SUCCESS: "#1DA624" = SUCCESS_GREEN

Const SUCCESS_GREEN

SUCCESS_GREEN: "#1DA624" = "#1DA624"

Const UI_BACKGROUND

UI_BACKGROUND: "#F1F3F5" = CLOUD_GRAY

Const UI_TEXT

UI_TEXT: "#585E67" = ANTHRACITE_GRAY

Const UI_TEXT_DISABLED

UI_TEXT_DISABLED: "#A2A6AB" = MATTER_GRAY

Const VALIDATION_RED

VALIDATION_RED: "#DF0D00" = "#DF0D00"

Const argv

argv: string[] = process.argv.slice()

Let sessionFrame

sessionFrame: SessionFrame | undefined

Const style

style: { statusBar: object } = StyleSheet.create({statusBar: {color: INVERSE_MAIN,},})

Type declaration

  • statusBar: object
    • color: string

Functions

Const Button

  • Button(props: React.PropsWithChildren<{ inverse?: undefined | false | true } & TouchableOpacity["props"]>): Element
  • Parameters

    • props: React.PropsWithChildren<{ inverse?: undefined | false | true } & TouchableOpacity["props"]>

    Returns Element

Const ButtonComponent

  • ButtonComponent(): never
  • Returns never

Const EmptySpacingView

  • EmptySpacingView(__namedParameters: { height: number; width: number }): Element
  • Parameters

    • __namedParameters: { height: number; width: number }
      • height: number
      • width: number

    Returns Element

Const ErrorBoundaryScreen

  • ErrorBoundaryScreen(): Element
  • Returns Element

Const Header

  • Header(props: React.PropsWithChildren<View["props"]>): Element
  • Parameters

    • props: React.PropsWithChildren<View["props"]>

    Returns Element

Const HeaderAction

  • HeaderAction(props: React.PropsWithChildren<{ icon: string } & TouchableOpacity["props"]>): Element
  • Parameters

    • props: React.PropsWithChildren<{ icon: string } & TouchableOpacity["props"]>

    Returns Element

InfoPoint

  • InfoPoint(target: unknown, propertyKey: string, descriptor: PropertyDescriptor): void
  • InfoPoint(manualData?: InfoPointData): (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void
  • Annotate methods you wish to be reported as InfoPoint to eum-cloud.

    Consider the following critical method which you wish to be reported as InfoPoint to eum-cloud.

    public infoPointMethod(arg1, arg2, value) {
        console.log("Executing infoPointMethod!");
    }

    Adding annotations to report info points automatically.

    For convenience purpose, you can simply annotate your methods without having to modify the code to manually report InfoPoints.

    @InfoPoint
    public infoPointMethod(arg1, arg2, value) {
        console.log("Executing infoPointMethod!");
    }

    Your method will automatically report info points to the eum cloud.

    Warning: If your code gets minified, the info point will report useless class and function names. You can either turn off minification for the annotated symbols, or you can manually specify the symbol names.

    To manually specify symbol names, pass a parameter to the InfoPoint decorator like this.

    @InfoPoint({ className: 'MyClass', fnName: 'infoPointMethod' })
    public infoPointMethod(arg1, arg2, value) {
        console.log("Executing infoPointMethod!");
    }

    Alternatively, you can exclude classes and functions from minification in the following way.

    • Install the npm package metro-minify-terser
    • Add this to your metro.config.js configuration file:
    transformer: {
     minifierPath: 'metro-minify-terser',
     minifierConfig: {
        // see: https://www.npmjs.com/package/terser
        keep_fnames: true,
        module: true
     }
    }
    see

    Instrumentation.trackCall

    Parameters

    • target: unknown
    • propertyKey: string
    • descriptor: PropertyDescriptor

    Returns void

  • Parameters

    Returns (target: unknown, propertyKey: string, descriptor: PropertyDescriptor) => void

      • (target: unknown, propertyKey: string, descriptor: PropertyDescriptor): void
      • Parameters

        • target: unknown
        • propertyKey: string
        • descriptor: PropertyDescriptor

        Returns void

Const JSAgentScreen

  • JSAgentScreen(): Element
  • Returns Element

Const Loader

  • Loader(_props: React.PropsWithChildren<{}>): Element
  • Parameters

    • _props: React.PropsWithChildren<{}>

    Returns Element

Const NavContainer

  • NavContainer(props: React.PropsWithChildren<View["props"]>): Element
  • Parameters

    • props: React.PropsWithChildren<View["props"]>

    Returns Element

NavPage

  • NavPage<T>(props: React.PropsWithChildren<{ currentPage: T; page: T } & View["props"]>): null | Element
  • Type parameters

    • T

    Parameters

    • props: React.PropsWithChildren<{ currentPage: T; page: T } & View["props"]>

    Returns null | Element

Const Spacer

  • Spacer(_props: Props<{}>): Element
  • Parameters

    • _props: Props<{}>

    Returns Element

Const Title

  • Title(props: React.PropsWithChildren<{}>): Element
  • Parameters

    • props: React.PropsWithChildren<{}>

    Returns Element

Const ToggleShutdownAgentScreen

  • ToggleShutdownAgentScreen(): Element
  • Returns Element

appState

applyPatch

  • applyPatch(patch: Patch): boolean
  • Applies a patch to a given file.

    throws

    Error if there was a problem applying the patch

    Parameters

    Returns boolean

    true if the patch was applied, false if it was skipped.

assertResultIs

  • assertResultIs(expected: boolean, actual: boolean): void
  • Parameters

    • expected: boolean
    • actual: boolean

    Returns void

Const colors

  • colors(inverse: boolean): { backgroundColor: string; color: string }
  • Parameters

    • inverse: boolean

    Returns { backgroundColor: string; color: string }

    • backgroundColor: string
    • color: string

convertToError

  • convertToError(e: unknown | Error): ADError
  • Parameters

    • e: unknown | Error

    Returns ADError

delay

  • delay(ms: number): Promise<void>
  • Parameters

    • ms: number

    Returns Promise<void>

generateNonCryptographicUniqueId

  • generateNonCryptographicUniqueId(): string
  • Basic unique id generator, not suited for cryptography.

    Returns string

guessClassName

  • guessClassName(target: unknown, ctx: unknown): string
  • Parameters

    • target: unknown
    • ctx: unknown

    Returns string

help

  • help(): void
  • Returns void

Const hoverColors

  • hoverColors(inverse: boolean): { backgroundColor: string; color: string }
  • Parameters

    • inverse: boolean

    Returns { backgroundColor: string; color: string }

    • backgroundColor: string
    • color: string

indexOfInjection

  • indexOfInjection(haystack: string, anchor: RegExp): number | undefined
  • Finds the index at which to insert the patch.

    Parameters

    • haystack: string
    • anchor: RegExp

    Returns number | undefined

    The string index where to insert the patch, or undefined if it failed to find the location.

initialState

  • initialState(): { appKey: string; collectorChoice: CollectorChoice; crashCallbackText: undefined | string; crashReportingEnabled: boolean; customCollectorURL: string; customScreenshotURL: string; error: undefined | string; jsAgentAjaxEnabled: boolean; jsAgentEnabled: boolean }
  • Returns { appKey: string; collectorChoice: CollectorChoice; crashCallbackText: undefined | string; crashReportingEnabled: boolean; customCollectorURL: string; customScreenshotURL: string; error: undefined | string; jsAgentAjaxEnabled: boolean; jsAgentEnabled: boolean }

    • appKey: string
    • collectorChoice: CollectorChoice
    • crashCallbackText: undefined | string
    • crashReportingEnabled: boolean
    • customCollectorURL: string
    • customScreenshotURL: string
    • error: undefined | string
    • jsAgentAjaxEnabled: boolean
    • jsAgentEnabled: boolean

install

  • install(): void
  • Returns void

isFunction

  • isFunction(t: unknown | Function): t is Function
  • Parameters

    • t: unknown | Function

    Returns t is Function

isPrime

  • isPrime(n: number): boolean
  • Parameters

    • n: number

    Returns boolean

isPromise

  • isPromise<T>(t: unknown): t is Promise<T>
  • Type parameters

    • T

    Parameters

    • t: unknown

    Returns t is Promise<T>

readTarget

  • readTarget(target: string): string
  • Parameters

    • target: string

    Returns string

sanitizeCustomData

  • sanitizeCustomData(t: unknown): any
  • Translates function arguments and return types to a serializable form suitable for the rn-bridge.

    Parameters

    • t: unknown

    Returns any

serializeLongValue

  • serializeLongValue(value: number): string
  • Parameters

    • value: number

    Returns string

Const styles

  • styles(height: number, width: number): { default: object }
  • Parameters

    • height: number
    • width: number

    Returns { default: object }

    • default: object
      • height: number
      • width: number

undoPatch

  • undoPatch(patch: Patch): void
  • Parameters

    Returns void

uninstall

  • uninstall(): void
  • Returns void

writeTarget

  • writeTarget(target: string, newContents: string): void
  • Parameters

    • target: string
    • newContents: string

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Private property
  • Private method
  • Static property
  • Static method

Generated using TypeDoc