Configuration options for the Sentry ReactNative SDK.

ReactNativeFrontend for more information.

interface NativescriptOptions {
    appHangsTimeoutInterval?: number;
    appPrefix?: string;
    attachScreenshot?: boolean;
    attachThreads?: boolean;
    attachViewHierarchy?: boolean;
    autoInitializeNativeSdk?: boolean;
    breadcrumbs?: {
        console?: boolean;
        dom?: boolean;
        fetch?: boolean;
        history?: boolean;
        sentry?: boolean;
        xhr?: boolean;
    };
    colnoOffset?: number;
    disabledNativeIntegrations?: string[];
    enableAppHangTracking?: boolean;
    enableAutoPerformanceTracking?: boolean;
    enableAutoSessionTracking?: boolean;
    enableCaptureFailedRequests?: boolean;
    enableNative?: boolean;
    enableNativeCrashHandling?: boolean;
    enableNativeNagger?: boolean;
    enableNdk?: boolean;
    enableNdkScopeSync?: boolean;
    enableSpotlight?: boolean;
    enableWatchdogTerminationTracking?: boolean;
    flushSendEvent?: boolean;
    headers?: { [k: string]: string };
    maxCacheItems?: number;
    maxQueueSize?: number;
    onerror?: boolean;
    onReady?: (response: { didCallNativeInit: boolean }) => void;
    onunhandledrejection?: boolean;
    patchGlobalPromise?: boolean;
    sessionTrackingIntervalMillis?: number;
    spotlightSidecarUrl?: string;
    [k: string]: any;
}

Hierarchy

  • Options<BrowserTransportOptions>
  • BaseNativescriptOptions
  • NativescriptErrorHandlersOptions
    • NativescriptOptions

Indexable

  • [k: string]: any

Properties

appHangsTimeoutInterval?: number

The minimum amount of time an app should be unresponsive to be classified as an App Hanging. The actual amount may be a little longer. Avoid using values lower than 100ms, which may cause a lot of app hangs events being transmitted. Value should be in seconds.

iOS only

2
appPrefix?: string

Optional prefix to add while rewriting frames

attachScreenshot?: boolean

When enabled and a user experiences an error, Sentry provides the ability to take a screenshot and include it as an attachment.

false
attachThreads?: boolean

When enabled, all the threads are automatically attached to all logged events on Android

attachViewHierarchy?: boolean

When enabled Sentry includes the current view hierarchy in the error attachments.

false
autoInitializeNativeSdk?: boolean

Initializes the native SDK on init. Set this to false if you have an existing native SDK and don't want to re-initialize.

NOTE: Be careful and only use this if you know what you are doing. If you use this flag, make sure a native SDK is running before the JS Engine initializes or events might not be captured. Also, make sure the DSN on both the React Native side and the native side are the same one. We strongly recommend checking the documentation if you need to use this.

true
breadcrumbs?: {
    console?: boolean;
    dom?: boolean;
    fetch?: boolean;
    history?: boolean;
    sentry?: boolean;
    xhr?: boolean;
}
colnoOffset?: number

offset applied to errors colno

disabledNativeIntegrations?: string[]

native integrations to disable.

enableAppHangTracking?: boolean

When enabled, the SDK tracks when the application stops responding for a specific amount of time defined by the appHangTimeoutInterval option.

iOS only

true
enableAutoPerformanceTracking?: boolean

Enable auto performance tracking by default.

enableAutoSessionTracking?: boolean

Should sessions be tracked to Sentry Health or not. Default to true!

enableCaptureFailedRequests?: boolean

When enabled, Sentry will capture failed XHR/Fetch requests. This option also enabled HTTP Errors on iOS. Sentry Android Gradle Plugin is needed to capture HTTP Errors on Android.

false
enableNative?: boolean

Enables native transport + device info + offline caching. Be careful, disabling this also breaks automatic release setting. This means you have to manage setting the release yourself. Defaults to true.

enableNativeCrashHandling?: boolean

Enables native crashHandling. This only works if enableNative is true. Defaults to true.

enableNativeNagger?: boolean

Should the native nagger alert be shown or not.

enableNdk?: boolean

Enable NDK on Android

true
enableNdkScopeSync?: boolean

Enable scope sync from Java to NDK on Android Only has an effect if enableNdk is true.

enableSpotlight?: boolean

This option will enable forwarding captured Sentry events to Spotlight.

More details: https://spotlightjs.com/

IMPORTANT: Only set this option to true while developing, not in production!

enableWatchdogTerminationTracking?: boolean

Enables Out of Memory Tracking for iOS and macCatalyst. See the following link for more information and possible restrictions: https://docs.sentry.io/platforms/apple/guides/ios/configuration/out-of-memory/

Renamed from enableOutOfMemoryTracking in v5.

true
flushSendEvent?: boolean
headers?: { [k: string]: string }
maxCacheItems?: number

The max cache items for capping the number of envelopes.

30
maxQueueSize?: number

The max queue size for capping the number of envelopes waiting to be sent by Transport.

onerror?: boolean
onReady?: (response: { didCallNativeInit: boolean }) => void

Callback that is called after the RN SDK on the JS Layer has made contact with the Native Layer.

onunhandledrejection?: boolean
patchGlobalPromise?: boolean

When enabled, Sentry will overwrite the global Promise instance to ensure that unhandled rejections are correctly tracked. If you run into issues with Promise polyfills such as core-js, make sure you polyfill after Sentry is initialized. Read more at https://docs.sentry.io/platforms/react-native/troubleshooting/#unhandled-promise-rejections

When disabled, this option will not disable unhandled rejection tracking. Set onunhandledrejection: false on the ReactNativeErrorHandlers integration instead.

true
sessionTrackingIntervalMillis?: number

The interval to end a session if the App goes to the background.

spotlightSidecarUrl?: string

This option changes the default Spotlight Sidecar URL.

By default, the SDK expects the Sidecar to be running on the same host as React Native Metro Dev Server.

More details: https://spotlightjs.com/

"http://localhost:8969/stream"