Skip to content

Commit 5c635c9

Browse files
committed
config radio buttons
add radio buttons to update the config snippets. Remaining portions of the page can further be controlled by the radio buttons, web build options for example
1 parent 6816bdc commit 5c635c9

File tree

5 files changed

+410
-43
lines changed

5 files changed

+410
-43
lines changed

platform-includes/debug-symbols/dart-plugin/dart.mdx

+1-43
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,7 @@ dev_dependencies:
1111
1212
The Sentry Dart Plugin requires basic configuration in your `pubspec.yaml` file:
1313

14-
```yaml {filename: pubspec.yaml}
15-
sentry:
16-
project: ___PROJECT_SLUG___
17-
org: ___ORG_SLUG___
18-
auth_token: ___ORG_AUTH_TOKEN___
19-
```
20-
21-
<Alert>
22-
23-
The option `upload_debug_symbols` is enabled by default. The plugin will automatically upload debug symbols for all platforms except Flutter Web.
24-
25-
</Alert>
26-
27-
### Enable Source Maps Upload
28-
29-
By default, source maps for Flutter Web are not uploaded. To enable source map uploads, add the `upload_source_maps` field:
30-
31-
```yaml {filename: pubspec.yaml}
32-
sentry:
33-
project: ___PROJECT_SLUG___
34-
org: ___ORG_SLUG___
35-
auth_token: ___ORG_AUTH_TOKEN___
36-
upload_source_maps: true
37-
```
38-
39-
### Enable Source Context
40-
41-
To upload source files for better context in stack traces, enable the `upload_sources` field:
42-
43-
```yaml {filename: pubspec.yaml}
44-
sentry:
45-
project: ___PROJECT_SLUG___
46-
org: ___ORG_SLUG___
47-
auth_token: ___ORG_AUTH_TOKEN___
48-
upload_sources: true
49-
```
50-
51-
<Alert>
52-
53-
This uploads the source files of the Dart/Flutter code, not the native code.
54-
For source context with native code, you need to set up source context in the respective native platform.
55-
56-
</Alert>
14+
<DebugSymbolConfig />
5715

5816
### Alternative Configuration Methods
5917

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
## Installation
2+
3+
In your `pubspec.yaml`, add `sentry_dart_plugin` as a new dev dependency:
4+
5+
```yaml {filename: pubspec.yaml}
6+
dev_dependencies:
7+
sentry_dart_plugin: ^{{@inject packages.version('sentry.dart.plugin', '2.0.0') }}
8+
```
9+
10+
## Configuration
11+
12+
The Sentry Dart Plugin requires basic configuration in your `pubspec.yaml` file:
13+
14+
<DebugSymbolConfig />
15+
16+
### Alternative Configuration Methods
17+
18+
In addition to configuring the plugin in `pubspec.yaml`, you can use:
19+
- Environment variables
20+
- Properties file
21+
22+
For more information, read the [Sentry Dart Plugin README](https://github.com/getsentry/sentry-dart-plugin/tree/main?tab=readme-ov-file#configuration-optional).
23+
24+
## Building Your Application
25+
26+
Before running the plugin, build your Flutter application with one of the following commands:
27+
28+
### Standard Build
29+
30+
```bash
31+
flutter build apk
32+
flutter build ios
33+
flutter build macos
34+
flutter build windows
35+
flutter build linux
36+
```
37+
38+
### Obfuscated Build (Recommended for Production)
39+
40+
Include the `--obfuscate` flag with the `--split-debug-info` option:
41+
42+
```bash
43+
flutter build apk --obfuscate --split-debug-info=<output-directory>
44+
flutter build ios --obfuscate --split-debug-info=<output-directory>
45+
flutter build macos --obfuscate --split-debug-info=<output-directory>
46+
flutter build windows --obfuscate --split-debug-info=<output-directory>
47+
flutter build linux --obfuscate --split-debug-info=<output-directory>
48+
```
49+
50+
### Flutter Web
51+
52+
For Flutter Web, generate source maps:
53+
54+
```bash
55+
flutter build web --release --source-maps
56+
```
57+
58+
## Running the Plugin
59+
60+
After building your application, run the plugin to upload debug symbols:
61+
62+
```bash
63+
flutter pub run sentry_dart_plugin
64+
```
65+
66+
<Alert>
67+
68+
If you don't obfuscate your build, the plugin won't upload debug symbols but will still configure source context if enabled.
69+
70+
</Alert>
71+
72+
## Android ProGuard Integration
73+
74+
If you have ProGuard (`minifyEnabled`) enabled, you must upload Android Proguard/R8 mapping files. You have two options:
75+
76+
1. **Use the Sentry Android Gradle Plugin (Recommended)**
77+
78+
After installing the [Sentry Android Gradle Plugin](/platforms/android/configuration/gradle/), set `autoInstallation` to `false` in your `app/build.gradle` file:
79+
80+
```groovy {filename: app/build.gradle}
81+
sentry {
82+
autoInstallation {
83+
enabled = false
84+
}
85+
}
86+
```
87+
88+
This is necessary because Sentry Flutter already ships with a compatible Sentry Android SDK, so we need to avoid conflicts.
89+
90+
Follow the [Android Gradle Plugin guide](/platforms/android/configuration/gradle/#proguardr8--dexguard) to complete the ProGuard mapping setup.
91+
92+
2. **Use the Sentry CLI**
93+
94+
Alternatively, you can use the [Sentry CLI](/cli/dif/#uploading-files) to manually upload mapping files.
95+
96+
<Alert>
97+
98+
Sentry's Flutter SDK doesn't currently support the `uploadNativeSymbols` flag from the Sentry Gradle Plugin.
99+
100+
</Alert>
101+
102+
## iOS and macOS dSYM Uploads
103+
104+
For iOS and macOS applications, you need to upload dSYM files. The Sentry Dart Plugin will automatically handle this when you build with the `--obfuscate` flag.
105+
106+
For non-obfuscated builds or additional configuration options, you can:
107+
108+
1. **Use the Sentry Cocoa script**
109+
110+
Follow the [Sentry Cocoa debug symbols guide](/platforms/apple/guides/ios/dsym/) to set up automatic dSYM uploads with the script.
111+
112+
2. **Use the Sentry CLI**
113+
114+
Use the [Sentry CLI](/platforms/apple/guides/ios/dsym/#upload-dsyms-with-cli) to manually upload dSYM files.
115+
116+
## Configuration Reference
117+
118+
The following table lists all available configuration options for the Sentry Dart Plugin:
119+
120+
<div style={{overflowX: 'auto', display: 'block', width: '100%'}}>
121+
122+
| Option | Type | Default | Description | Environment Variable |
123+
|--------|------|---------|-------------|---------------------|
124+
| `project` | string | | **Required.** Your project's name (e.g., `sentry-flutter`) | `SENTRY_PROJECT` |
125+
| `org` | string | | **Required.** Your organization's slug (e.g., `sentry-sdks`) | `SENTRY_ORG` |
126+
| `auth_token` | string | | **Required.** The Sentry auth token | `SENTRY_AUTH_TOKEN` |
127+
| `upload_debug_symbols` | boolean | `true` | Enables or disables automatic upload of debug symbols | |
128+
| `upload_source_maps` | boolean | `false` | Enables or disables automatic upload of source maps | |
129+
| `upload_sources` | boolean | `false` | Enables or disables source code upload | |
130+
| `url` | string | | The URL of your Sentry instance | `SENTRY_URL` |
131+
| `wait_for_processing` | boolean | `false` | Whether to wait for server-side processing of uploaded files | |
132+
| `log_level` | string | `warn` | Configures the log level for sentry-cli (`trace`, `debug`, `info`, `warn`, `error`) | `SENTRY_LOG_LEVEL` |
133+
| `release` | string | `name@version` from pubspec | The release version for source maps | `SENTRY_RELEASE` |
134+
| `dist` | string | | Custom distribution identifier | `SENTRY_DIST` |
135+
| `web_build_path` | string | `build/web` | The web build folder path | |
136+
| `commits` | string | `auto` | Release commits integration | |
137+
| `ignore_missing` | boolean | `false` | Ignore missing commits previously used in the release | |
138+
| `bin_dir` | string | `.dart_tool/pub/bin/sentry_dart_plugin` | The folder where the plugin downloads the sentry-cli binary | |
139+
| `bin_path` | string | | Path to a sentry-cli binary to use instead of downloading | |
140+
| `sentry_cli_cdn_url` | string | `https://downloads.sentry-cdn.com/sentry-cli` | Alternative place to download sentry-cli | `SENTRYCLI_CDNURL` |
141+
142+
</div>
143+
144+
## Troubleshooting
145+
146+
If you encounter any issues with the Sentry Dart Plugin, refer to [Troubleshooting - Sentry Dart Plugin](/platforms/dart/guides/flutter/troubleshooting#sentry-dart-plugin) for solutions to common problems.

0 commit comments

Comments
 (0)