Cordova

This is the documentation for our Corodva SDK. The SDK uses a native extension for iOS and Android but will fall back to a pure JavaScript version (raven-js) if needed.

Installation

Start by adding Sentry and then linking it:

$ cordova plugin add @sentry/cordova

Our new Sentry Wizard will help you to configure your project. We also add a build step to your Xcode project to upload debug symbols we need to symbolicate iOS crashes.

Configuration

This example shows the bare minium for a plain Cordova project. Add this to you index.js:

onDeviceReady: function() {
    ...
    var Sentry = cordova.require("cordova-plugin-sentry.SentryCordovaBundle").default;
    var SentryBrowser = cordova.require("cordova-plugin-sentry.SentryCordovaBundle").SentryBrowser;
    var SentryCordova = cordova.require("cordova-plugin-sentry.SentryCordovaBundle").SentryCordova;

    Sentry.create('___DSN___')
        .use(SentryCordova, {sentryBrowser: SentryBrowser})
        .install();
    ...
}

This will setup the Client for native and JavaScript crashes. If you minify or bundle your code we need your sourcemap files in order to symbolicate JavaScript errors, please see: JavaScript sourcemaps for more details.

iOS Specifics

When you use Xcode you can hook directly into the build process to upload debug symbols. If you however are using bitcode you will need to disable the “Upload Debug Symbols to Sentry” build phase and then separately upload debug symbols from iTunes Connect to Sentry.