Skip to content

Connect an SDK

CrashCart speaks the Sentry envelope protocol, so setup is the Sentry SDK's own setup with a CrashCart DSN. Nothing CrashCart-specific is needed in the client.

The snippets below show the minimum. Two options are worth setting on every platform:

  • release — CrashCart groups release health and symbol files by release. Most SDKs read it from the app bundle automatically; set it explicitly when they don't.
  • environmentproduction, staging, … Shown as a filter in the viewer.

Replace DSN with the project's DSN (http://<key>@crashcart.example.com/<id>).

Mobile

swift
import Sentry

SentrySDK.start { options in
    options.dsn = "DSN"
    options.environment = "production"
    // release defaults to bundle id @ version + build
}
kotlin
// AndroidManifest.xml
<application>
  <meta-data android:name="io.sentry.dsn" android:value="DSN" />
  <meta-data android:name="io.sentry.environment" android:value="production" />
</application>
dart
await SentryFlutter.init(
  (options) {
    options.dsn = 'DSN';
    options.environment = 'production';
  },
  appRunner: () => runApp(const MyApp()),
);
js
import * as Sentry from '@sentry/react-native';

Sentry.init({ dsn: 'DSN', environment: 'production' });

For Android, the Sentry Android Gradle plugin uploads ProGuard / R8 mappings automatically — see Symbolication for the sentry.properties it needs.

Web

js
import * as Sentry from '@sentry/browser';

Sentry.init({
  dsn: 'DSN',
  release: 'shop-web@2.4.1',   // must match the source map upload
  environment: 'production',
});

CrashCart answers CORS preflight for ingest; set CORS_ORIGIN to your site's origin instead of the default * in production.

Backend

js
import * as Sentry from '@sentry/node';   // or @sentry/bun

Sentry.init({ dsn: 'DSN', release: process.env.GIT_SHA });
python
import sentry_sdk

sentry_sdk.init(dsn="DSN", release="api@2.4.1", environment="production")
go
import "github.com/getsentry/sentry-go"

sentry.Init(sentry.ClientOptions{Dsn: "DSN", Release: "api@2.4.1"})
defer sentry.Flush(2 * time.Second)
rust
let _guard = sentry::init(("DSN", sentry::ClientOptions {
    release: sentry::release_name!(),
    ..Default::default()
}));
java
Sentry.init(options -> {
  options.setDsn("DSN");
  options.setRelease("api@2.4.1");
});
csharp
SentrySdk.Init(o => {
  o.Dsn = "DSN";
  o.Release = "api@2.4.1";
});

What the SDK sends that CrashCart uses

FieldSDK sourceShown as
levelevent.levelfatal / error / warning / info / debug
messagelogentry.formatted or exception valueIssue title
releaseevent.release / contexts.app.app_versionRelease, release health
environmentevent.environmentFilter
error_typeexception.values[0].typeIssue title
error_locationcomputed: deepest in-app frameCartFragment.java:142
device_model, os_versioncontexts.device, contexts.osBreakdown
user.iduser.idFilter, affected users
handledexception.mechanism.handledfalse = crash
breadcrumbs, tags, extraas sentEvent detail

Sessions (session / sessions items) feed release health. Transactions, profiles, replays and client reports are accepted and discarded.

Set PII_REDACT=true to scrub emails, phone numbers, tokens and user ids before events are stored.

Verifying the connection

  1. Send a test message: Sentry.captureMessage("hello crashcart") (every SDK has an equivalent).
  2. Open the project in the viewer. A message event shows up under Events; exceptions also appear under Issues.
  3. If nothing arrives, check the SDK's debug output for the HTTP status from /api/<id>/envelope/: 401 is a wrong key, 404 a wrong project id, 429 the rate limit.

The compatibility matrix lists the SDK versions exercised end to end with real clients.

Released under the MIT License.