SDK 12.1.0 Migration Guide forReact Native

Guide for migrating to Instabug's SDK version 12.0 on React Native

With the release of version 12.1.0, a whole host of new products have been released such as, Session Replay, App Ratings, and Rollout Management. Along with this release, a few APIs have been changed to better suit these new features and in order to improve the usage of these APIs.

Initializing the SDK

If you're using Instabug.start to initialize the Instabug SDK, you'll need to migrate to the new Instabug.init method introduced in v11.9.0.

Before

Instabug.start('<APP_TOKEN>', [InvocationEvent.shake]);
Instabug.setSdkDebugLogsLevel(Instabug.sdkDebugLogsLevel.sdkDebugLogsLevelVerbose);

After

Instabug.init({
  token: '<APP_TOKEN>',
  invocationEvents: [InvocationEvent.shake],
  debugLogsLevel: LogLevel.verbose,
});

Removed APIs & Alternatives

Deprecated APICorresponding API
Instabug.startInstabug.init
Instabug.setSdkDebugLogsLevelInstabug.init's debugLogsLevel parameter.
Instabug.setDebugEnabledInstabug.init's debugLogsLevel parameter
Instabug.setReproStepsModeInstabug.setReproStepsConfig
Instabug.enableInstabug.setEnabled(true)
Instabug.disableInstabug.setEnabled(false)
Instabug.isRunningLiveYou can manage and check your app running environment using environment variables.
Instabug.setPrivateViewInstabug.addPrivateView
Instabug.callPrivateApiRemoved.
CrashReporting.reportJSExceptionCrashReporting.reportError
APM.setLogLevelInstabug.init's debugLogsLevel parameter
StringKey.discardAlertActionStringKey.discardAlertStay and StringKey.discardAlertDiscard
StringKey.discardAlertCancelStringKey.discardAlertStay and StringKey.discardAlertDiscard
StringKey.invalidCommentMessageStringKey.insufficientContentMessage
StringKey.invalidCommentTitleStringKey.insufficientContentTitle
StringKey.reproStepsListItemTitleStringKey.reproStepsListItemNumberingTitle

Using Promises instead of Callbacks

The below APIs previously had a callback parameter which is invoked with the result. Since then, we've migrated them to use Promises instead for convenience.

Instabug.getTags
Instabug.getUserAttribute
Instabug.getAllUserAttributes
Replies.hasChats
Replies.getUnreadRepliesCount
Surveys.getAvailableSurveys
Surveys.hasRespondedToSurvey

You can use the returned Promise as follows:

const tags = await Instabug.getTags();

Removed Enums

All the enums that were available as properties under modules similar to Instabug.invocationEvent and BugReporting.option have been deprecated and removed in favor of the new standalone enums introduced in v11.9.0.

Here is the full list of removed enums and their alternatives:

RemovedAlternative
Instabug.invocationEventInvocationEvent
Instabug.reproStepsModeReproStepsMode
Instabug.dismissTypeDismissType
Instabug.sdkDebugLogsLevelLogLevel
Instabug.extendedBugReportModeExtendedBugReportMode
Instabug.localeLocale
Instabug.colorThemeColorTheme
Instabug.floatingButtonEdgeFloatingButtonPosition
Instabug.IBGPositionRecordingButtonPosition
Instabug.welcomeMessageModeWelcomeMessageMode
Instabug.actionTypesActionType
Instabug.stringsStringKey
FeatureRequests.actionTypesActionType
BugReporting.invocationEventInvocationEvent
BugReporting.extendedBugReportModeExtendedBugReportMode
BugReporting.reportTypeReportType
BugReporting.optionInvocationOption
BugReporting.positionRecordingButtonPosition
APM.logLevelLogLevel and the debugLogsLevel in Instabug.init’s config.