Bugsnag
4 minute read
Bugsnag provides error reporting libraries for major software platforms which automatically detect and report errors in your applications, and capture diagnostic data required to help you reproduce and fix each error.
Connection compatibility
| Destination Information | |||
|---|---|---|---|
| |||
In the web device mode integration, that is, using JavaScript SDK as a source, RudderStack loads the Bugsnag native SDK from the
https://d2wy8f7a9ursnm.cloudfront.net/domain.Based on your website’s content security policy, you might need to allowlist this domain to load the Bugsnag SDK successfully.
Get started
Once you have confirmed that the platform supports sending events to Bugsnag, follow these steps:
- From your RudderStack dashboard, add a source. Then, from the list of destinations, select Bugsnag.
- Assign a name to the destination and click Next.
Connection settings
To successfully set up Bugsnag as a destination, you will need to configure the following settings:
- Bugsnag API Key: Enter your BugSnag API key. You can find the API key in your Bugsnag dashboard under Settings > Project Settings.
- Use device-mode to send events: As this is a device mode-only destination, this setting is turned on by default and cannot be toggled off.
- Release Stage: Use this setting to specify the release stage of your app:
- Toggle it on for
Developmentstage. - Keep it toggled off for
Productionstage.
- Toggle it on for
- SSL: This option is turned on by default and causes RudderStack to use SSL while sending data to Bugsnag.
Adding Bugsnag to mobile project
Once you add Bugsnag as a destination in the RudderStack dashboard, follow these steps to add it to your mobile project depending on your integration platform:
Follow these steps to add Bugsnag to your Android Project:
- Add the following
repositoryto yourapp/build.gradlefile.
repositories {
mavenCentral()
}- Add the following
dependenciesin the same file:
implementation 'com.rudderstack.android.sdk:core:1.0.1-beta.1'
implementation 'com.rudderstack.android.integration:bugsnag:0.1.0-beta.1'- Change the initialization of your
RudderClientin yourApplicationclass:
// initialize Rudder SDK
val rudderClient =
RudderClient.getInstance(
this,
WRITE_KEY,
RudderConfig.Builder()
.withDataPlaneUrl(DATA_PLANE_URL)
.withFactory(BugsnagIntegrationFactory.FACTORY)
.build()
)Follow these steps to add Bugsnag to your iOS project:
- Go to
Podfileand add theRudder-Bugsnagextension:
pod 'Rudder-Bugsnag', '0.1.0-beta.1'- After adding the dependency followed by
pod install, you can add the imports to yourAppDelegate.mfile as shown:
#import "RudderBugsnagFactory.h"- Change the initialization of your
RudderClientas shown:
RudderConfigBuilder *builder = [[RudderConfigBuilder alloc] init];
[builder withDataPlaneUrl:<your_data_plane_url>];
[builder withFactory:[RudderBugsnagFactory instance]];
[RudderClient getInstance:<your_write_key> config:[builder build]];Follow these steps to add Bugsnag to your iOS project:This device mode integration is supported for Bugsnag v6.16.4 and above.
- Install
RudderBugsnag(available through CocoaPods) by adding the following line to yourPodfile:
pod 'RudderBugsnag', '~> 1.0.0'- Run the
pod installcommand. - Import the SDK depending on your preferred platform:
import RudderBugsnag@import RudderBugsnag;- Add the imports to your
AppDelegatefile under thedidFinishLaunchingWithOptionsmethod:
let config: RSConfig = RSConfig(writeKey: WRITE_KEY)
.dataPlaneURL(DATA_PLANE_URL)
RSClient.sharedInstance().configure(with: config)
RSClient.sharedInstance().addDestination(RudderBugsnagDestination())RSConfig *config = [[RSConfig alloc] initWithWriteKey:WRITE_KEY];
[config dataPlaneURL:DATA_PLANE_URL];
[[RSClient sharedInstance] configureWith:config];
[[RSClient sharedInstance] addDestination:[[RudderBugsnagDestination alloc] init]];Identify
The identify method lets you identify a user and associate them to their actions. It also lets you record any traits about them like their name, email, etc.
A sample identify call is shown below:
rudderanalytics.identify("1hKOmRA4el9Zt1WSfVJIVo4GRlm", {
name: "Alex Keener",
email: "alex@example.com",
});Bugsnag will show the userId and traits in the Users tab of each error.
Error reporting
Along with user-specific information, you can also use Bugsnag to track handled exceptions data to your dashboard using Bugsnag’s native methods. See the Bugsnag documentation for more information on these functions.
FAQ
Where can I find the Bugsnag API Key?
- Log in to your Bugsnag dashboard.
- Click Settings at the top right corner.
- Click Project Settings to find the API key as shown:

What is meant by release stage?
You can distinguish errors that happen in different stages of your app’s release process, for example, production, development, etc.
Do I need to use SSL to send the event data to Bugsnag?
RudderStack recommends using SSL to send data to Bugsnag in web device mode.