instabug-reactnative
TypeScript icon, indicating that this package has built-in type declarations

14.0.0 • Public • Published

Instabug for React Native

npm npm npm Twitter Analytics

Instabug is an in-app feedback and bug reporting tool for mobile apps. With just a simple shake, your users or beta testers can report bugs or send in-app feedback and the SDK will capture an environment snapshot of your user's device including all console logs, and server-side network requests compiling all these details in one organised dashboard to help you debug and fix bugs faster.

Instabug also provides you with a reliable crash reporter that automatically captures a detailed report of the running environment, the different threads’ states, the steps to reproduce the crash, and the network request logs. All the data is captured automatically with no need for breadcrumbs, and you can always reply back to your users and they will receive your messages within the app.

For more info, visit Instabug.com.

Installation

  1. In Terminal, navigate to your React Native directory and install the instabug-reactnative package:

    npm install instabug-reactnative

    Or if you prefer to use Yarn instead of npm:

    yarn add instabug-reactnative
  2. CocoaPods on iOS needs this extra step:

    cd ios && pod install && cd ..

Initializing Instabug

To start using Instabug, import it as follows, then initialize it in the constructor or componentWillMount. This line will let the SDK work with the default behavior. The SDK will be invoked when the device is shaken. You can customize this behavior through the APIs.

import Instabug from 'instabug-reactnative';

Instabug.init({
  token: 'APP_TOKEN',
  invocationEvents: [Instabug.invocationEvent.shake],
});

You can find your app token by selecting the SDK tab from your Instabug dashboard.

⚠️ If you're updating the SDK from versions prior to v11, please check our migration guide.

Microphone and Photo Library Usage Description (iOS Only)

Instabug needs access to the microphone and photo library to be able to let users add audio and video attachments. Starting from iOS 10, apps that don’t provide a usage description for those 2 permissions would be rejected when submitted to the App Store.

For your app not to be rejected, you’ll need to add the following 2 keys to your app’s info.plist file with text explaining to the user why those permissions are needed:

  • NSMicrophoneUsageDescription
  • NSPhotoLibraryUsageDescription

If your app doesn’t already access the microphone or photo library, we recommend using a usage description like:

  • "<app name> needs access to the microphone to be able to attach voice notes."
  • "<app name> needs access to your photo library for you to be able to attach images."

The permission alert for accessing the microphone/photo library will NOT appear unless users attempt to attach a voice note/photo while using Instabug.

Uploading Source Map Files for Crash Reports

For your app crashes to show up with a fully symbolicated stack trace, we will automatically generate the source map files and upload them to your dashboard on release build. To do so, we rely on your app token being explicitly added to Instabug.init({token: 'YOUR_APP_TOKEN'}) in JavaScript.

If your app token is defined as a constant, you can set an environment variable INSTABUG_APP_TOKEN to be used instead. We also automatically read your versionName and versionCode to upload your sourcemap file. alternatively, can also set the environment variables INSTABUG_APP_VERSION_NAME and INSTABUG_APP_VERSION_CODE to be used instead.

To disable the automatic upload, you can set the environment variable INSTABUG_SOURCEMAPS_UPLOAD_DISABLE to TRUE.

Network Logging

Instabug network logging is enabled by default. It intercepts any requests performed with fetch or XMLHttpRequest and attaches them to the report that will be sent to the dashboard. To disable network logs:

import { NetworkLogger } from 'instabug-reactnative';
NetworkLogger.setEnabled(false);

Repro Steps

Instabug Repro Steps are enabled by default. It captures a screenshot of each screen the user navigates to. These screens are attached to the BugReport when sent.

We support the two most popular React Native navigation libraries:

  • react-navigation

    • v5 set the onStateChange to Instabug.onStateChange in your NavigationContainer as follows:

      <NavigationContainer onStateChange={Instabug.onStateChange} />
    • <=v4 set the onNavigationStateChange to Instabug.onNavigationStateChange in your App wrapper as follows:

      export default () => <App onNavigationStateChange={Instabug.onNavigationStateChange} />;
  • react-native-navigation

    Register Instabug.componentDidAppearListener listener using:

    Navigation.events().registerComponentDidAppearListener(Instabug.componentDidAppearListener);

Alternatively, you can report your screen changes manually using the following API

Instabug.reportScreenChange('screenName');

You can disable Repro Steps using the following API:

Instabug.setReproStepsConfig({ all: ReproStepsMode.disabled });

Documentation

For more details about the supported APIs and how to use them, check our Documentation.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
14.0.0752latest
14.0.0-1330838-SNAPSHOT19snapshot

Version History

VersionDownloads (Last 7 Days)Published
14.0.0-1330838-SNAPSHOT19
14.0.0-1326154-SNAPSHOT41
14.0.0-1326970-SNAPSHOT1
14.0.0-1288694-SNAPSHOT1
14.0.0-1288558-SNAPSHOT0
14.0.0-1319578-SNAPSHOT5
14.0.0752
13.4.0-1319209-SNAPSHOT0
13.4.0-1307208-SNAPSHOT0
13.4.0-1294916-SNAPSHOT0
13.4.0-1294138-SNAPSHOT1
13.4.0-1294193-SNAPSHOT0
13.4.0-1297183-SNAPSHOT1
13.4.0-1280620-SNAPSHOT0
1.0.0-1294175-SNAPSHOT0
13.4.01,196
12.1.0-1048171-SNAPSHOT0
12.1.0-1051891-SNAPSHOT0
12.4.3-1066501-SNAPSHOT1
12.1.0-1049852-SNAPSHOT0
12.1.0-1048700-SNAPSHOT1
12.1.0-1054412-SNAPSHOT0
11.14.0-1021327-SNAPSHOT1
12.6.0-000110-SNAPSHOT0
12.6.0-1112360-SNAPSHOT0
12.2.0-1066444-SNAPSHOT0
11.14.0-1021114-SNAPSHOT0
12.6.0-1121246-SNAPSHOT0
12.4.0-1084321-SNAPSHOT0
12.4.0-1083139-SNAPSHOT0
12.2.0-1071416-SNAPSHOT0
12.2.0-1069543-SNAPSHOT0
12.1.0-1051883-SNAPSHOT0
12.1.0-000941-SNAPSHOT0
11.9.1-000358-SNAPSHOT0
11.9.1-000145-SNAPSHOT0
11.3.0-834800-SNAPSHOT0
11.3.0-000895-SNAPSHOT1
11.14.0-1021625-SNAPSHOT0
11.13.0-000281-SNAPSHOT0
11.12.0-991709-SNAPSHOT0
11.10.0-975940-SNAPSHOT1
11.10.0-975725-SNAPSHOT0
11.10.0-970721-SNAPSHOT0
11.10.0-980949-SNAPSHOT0
11.0.2-000998-SNAPSHOT0
11.0.2-000614-SNAPSHOT0
11.0.1-735863-SNAPSHOT0
11.0.1-000786-SNAPSHOT0
10.9.1-000144-SNAPSHOT0
10.9.1-646529-SNAPSHOT0
10.8.1-000942-SNAPSHOT1
10.8.1-627566-SNAPSHOT0
10.8.0-000936-SNAPSHOT1
10.4.0-000131-SNAPSHOT0
10.4.0-000940-SNAPSHOT0
10.13.0-707145-SNAPSHOT0
10.13.0-000396-SNAPSHOT0
10.13.0-705630-SNAPSHOT0
10.11.0-000191-SNAPSHOT0
10.11.0-000352-SNAPSHOT0
10.11.0-000139-SNAPSHOT0
10.11.0-674301-SNAPSHOT0
10.11.0-661509-SNAPSHOT0
10.0.0-000960-SNAPSHOT0
10.0.0-567222-SNAPSHOT0
10.0.0-565328-SNAPSHOT0
10.0.0-000380-SNAPSHOT0
10.11.0-000527-SNAPSHOT1
10.0.0-560617-SNAPSHOT0
11.0.1-000286-SNAPSHOT0
10.9.0-000203-SNAPSHOT0
10.9.0-000767-SNAPSHOT1
10.8.1-000885-SNAPSHOT0
10.0.0-000408-SNAPSHOT0
10.11.0-000676-SNAPSHOT1
10.9.1-000303-SNAPSHOT0
12.4.3-1067260-SNAPSHOT0
10.9.0-000298-SNAPSHOT0
10.8.1-000570-SNAPSHOT0
10.8.1-000582-SNAPSHOT0
10.8.1-000228-SNAPSHOT0
10.8.2-000761-SNAPSHOT0
10.8.1-000815-SNAPSHOT0
10.8.1-000982-SNAPSHOT0
10.4.0-000482-SNAPSHOT0
10.11.0-000750-SNAPSHOT0
10.0.0-567508-SNAPSHOT0
10.0.0-000487-SNAPSHOT0
10.0.0-000896-SNAPSHOT0
10.0.0-000776-SNAPSHOT0
10.0.0-000600-SNAPSHOT0
13.3.0-1274548-SNAPSHOT0
12.1.0-1048728-SNAPSHOT0
13.3.01,395
13.2.0124
13.1.11,105
13.0.527
13.0.40
13.0.0315
12.9.0425
12.8.0269
12.7.10
12.7.02
12.6.06
12.5.00
12.4.046
12.2.00
12.1.014
11.14.0438
11.13.0239
11.12.02
11.10.018
11.9.120
11.9.00
11.6.00
11.5.18
11.5.00
11.3.010
11.2.01
11.0.218
11.0.10
11.0.09
10.13.048
10.11.00
10.9.11
10.9.00
10.8.12
10.8.01
10.4.013
10.0.012
9.1.100
9.1.91
9.1.80
9.1.70
9.1.60
9.1.10
9.1.00
9.0.70
9.0.60
9.0.50
9.0.10
9.0.00
8.7.30
8.7.20
8.7.10
8.7.00
8.6.40
8.6.31
8.6.21
8.6.10
8.5.60
8.5.50
8.5.40
8.5.30
8.5.20
8.5.10
8.5.00
8.4.40
8.4.30
8.4.21
8.4.10
8.4.03
8.3.40
8.3.30
8.3.20
8.3.10
8.3.00
8.2.71
8.2.60
8.2.50
8.2.40
8.2.30
8.2.21
8.2.11
8.2.00
8.1.60
8.1.51
8.1.40
8.1.30
8.1.20
8.1.00
8.0.260
8.0.250
8.0.240
8.0.231
8.0.220
8.0.210
8.0.200
8.0.190
8.0.180
8.0.170
8.0.160
8.0.150
8.0.140
8.0.131
8.0.120
8.0.111
8.0.100
8.0.90
8.0.80
8.0.71
8.0.61
8.0.50
8.0.40
8.0.31
8.0.20
8.0.10
8.0.00
2.13.33
2.13.21
2.13.11
2.13.00
2.12.03
2.11.20
2.11.11
2.11.00
2.10.00
2.9.00
2.8.10
2.8.00
2.7.10
2.7.00
2.6.00
2.5.30
2.5.10
2.5.00
2.4.10
2.4.01
2.3.00
2.2.21
2.2.11
2.2.00
2.1.20
2.1.11
2.1.00
2.0.190
2.0.182
2.0.170
2.0.160
2.0.150
2.0.140
2.0.130
2.0.120
2.0.110
2.0.100
2.0.97
2.0.81
2.0.70
2.0.60
2.0.50
2.0.40
2.0.30
2.0.20
2.0.11
2.0.00
1.2.40
1.2.30
1.2.20
1.2.10
1.2.00
1.1.90
1.1.80
1.1.70
1.1.60
1.1.40
1.1.30
1.1.20
1.1.10
1.1.00
1.0.80
1.0.70

Package Sidebar

Install

npm i instabug-reactnative

Weekly Downloads

6,636

Version

14.0.0

License

MIT

Unpacked Size

1.27 MB

Total Files

189

Last publish

Collaborators

  • heshammegid
  • instabug-new
  • abdelhamid-nasser
  • aalaa_instabug
  • kholood
  • mzakibg
  • a7medev