Skip to content

Commit a1e10d1

Browse files
sfanahataShannon Anahatabuenaflor
authored
Adding types and defaults to Flutter options (#15213)
## DESCRIBE YOUR PR Flutter needed types and defaults added from the SDKoption migration Preview: https://sentry-docs-git-flutter-options-updates.sentry.dev/platforms/dart/guides/flutter/configuration/options/ ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Shannon Anahata <[email protected]> Co-authored-by: Giancarlo Buenaflor <[email protected]>
1 parent 4c0ca3a commit a1e10d1

File tree

1 file changed

+50
-50
lines changed
  • docs/platforms/dart/guides/flutter/configuration

1 file changed

+50
-50
lines changed

docs/platforms/dart/guides/flutter/configuration/options.mdx

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,73 +14,73 @@ Options that can be read from an environment variable (`SENTRY_DSN`, `SENTRY_ENV
1414

1515
<SdkOption name="dsn" type="string" envVar="SENTRY_DSN">
1616

17-
The DSN tells the SDK where to send the events. If this value is not provided, the SDK will try to read it from the `SENTRY_DSN` environment variable. If that variable also does not exist, the SDK will just not send any events.
17+
The DSN tells the SDK where to send the events. If this value is not provided, the SDK will try to read it from the `SENTRY_DSN` environment variable. If that variable also does not exist, the SDK will not send any events.
1818

1919
In runtimes without a process environment (such as the browser) that fallback does not apply.
2020

2121
Learn more about [DSN utilization](/product/sentry-basics/dsn-explainer/#dsn-utilization).
2222

2323
</SdkOption>
2424

25-
<SdkOption name="debug">
25+
<SdkOption name="debug" type="bool" defaultNote="true in debug mode, false otherwise">
2626

2727
Turns debug mode on or off. If debug is enabled SDK will attempt to print out useful debugging information if something goes wrong with sending the event. The default is `true` if your app runs in [debug mode](https://docs.flutter.dev/testing/build-modes#debug), otherwise it is `false`. It's generally not recommended to turn it on in production, though turning `debug` mode on will not cause any safety concerns.
2828

2929
</SdkOption>
3030

31-
<SdkOption name="diagnosticLevel">
31+
<SdkOption name="diagnosticLevel" type="enum" defaultValue="warning">
3232

3333
Enabling `debug` mode makes the SDK generate as much diagnostic data as possible. However, if you'd prefer to lower the verbosity of the Sentry SDK diagnostics logs, configure this option to set the appropriate level:
3434

35-
- `debug`: **default** The most verbose mode
35+
- `debug`: The most verbose mode
3636
- `info`: Informational messages
37-
- `warning`: Warning that something might not be right
37+
- `warning`: **default** Warning that something might not be right
3838
- `error`: Only SDK internal errors are printed
3939
- `fatal`: Only critical errors are printed
4040

4141
</SdkOption>
4242

43-
<SdkOption name="dist">
43+
<SdkOption name="dist" type="string">
4444

4545
Sets the distribution of the application. Distributions are used to disambiguate build or deployment variants of the same release of an application. For example, the dist can be the build number of an Xcode build or the version code of an Android build. The dist has a max length of 64 characters.
4646

4747
</SdkOption>
4848

49-
<SdkOption name="release">
49+
<SdkOption name="release" type="string" envVar="SENTRY_RELEASE">
5050

5151
Sets the release. Some SDKs will try to automatically configure a release out of the box but it's a better idea to manually set it to guarantee that the release is in sync with your deploy integrations or source map uploads. Release names are strings, but some formats are detected by Sentry and might be rendered differently. Learn more about how to send release data so Sentry can tell you about regressions between releases and identify the potential source in [the releases documentation](/product/releases/) or the <SandboxLink scenario="releases">sandbox</SandboxLink>.
5252

5353
By default the SDK will try to read this value from the `SENTRY_RELEASE` environment variable (in the browser SDK, this will be read off of the `window.SENTRY_RELEASE.id` if available).
5454

5555
</SdkOption>
5656

57-
<SdkOption name="environment">
57+
<SdkOption name="environment" type="string" envVar="SENTRY_ENVIRONMENT">
5858

5959
Sets the environment. This string is freeform and not set by default. A release can be associated with more than one environment to separate them in the UI (think `staging` vs `prod` or similar).
6060

6161
By default the SDK will try to read this value from the `SENTRY_ENVIRONMENT` environment variable (except for the browser SDK where this is not applicable).
6262

6363
</SdkOption>
6464

65-
<SdkOption name="sampleRate">
65+
<SdkOption name="sampleRate" type="float" defaultValue="1.0">
6666

6767
Configures the sample rate for error events, in the range of `0.0` to `1.0`. The default is `1.0`, which means that 100% of error events will be sent. If set to `0.1`, only 10% of error events will be sent. Events are picked randomly.
6868

6969
</SdkOption>
7070

71-
<SdkOption name="maxBreadcrumbs">
71+
<SdkOption name="maxBreadcrumbs" type="int" defaultValue="100">
7272

7373
This variable controls the total amount of breadcrumbs that should be captured. This defaults to `100`, but you can set this to any number. However, you should be aware that Sentry has a [maximum payload size](https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits) and any events exceeding that payload size will be dropped.
7474

7575
</SdkOption>
7676

77-
<SdkOption name="maxCacheItems">
77+
<SdkOption name="maxCacheItems" type="int" defaultValue="30">
7878

7979
The maximum number of [envelopes](https://develop.sentry.dev/sdk/data-model/envelopes/) to keep in cache. The SDKs use envelopes to send data, such as events, attachments, user feedback, and sessions to sentry.io. An envelope can contain multiple items, such as an event with a session and two attachments. Depending on the usage of the SDK, the size of an envelope can differ. If the number of envelopes in the local cache exceeds `max-cache-items`, the SDK deletes the oldest envelope and migrates the sessions to the next envelope to maintain the integrity of your release health stats. The default is `30`.
8080

8181
</SdkOption>
8282

83-
<SdkOption name="attachStacktrace">
83+
<SdkOption name="attachStacktrace" type="bool" defaultValue="true">
8484

8585
When enabled, stack traces are automatically attached to all messages logged. Stack traces are always attached to exceptions; however, when this option is set, stack traces are also sent with messages. This option, for instance, means that stack traces appear next to all log messages.
8686

@@ -90,7 +90,7 @@ Grouping in Sentry is different for events with stack traces and without. As a r
9090

9191
</SdkOption>
9292

93-
<SdkOption name="sendDefaultPii">
93+
<SdkOption name="sendDefaultPii" type="bool" defaultValue="false">
9494

9595
If this flag is enabled, certain personally identifiable information (PII) is added by active integrations. By default, no such data is sent.
9696

@@ -106,21 +106,21 @@ If you enable this option, be sure to manually remove what you don't want to sen
106106

107107
</SdkOption>
108108

109-
<SdkOption name="serverName">
109+
<SdkOption name="serverName" type="string">
110110

111111
This option can be used to supply a server name. When provided, the name of the server is sent along and persisted in the event. For many integrations, the server name actually corresponds to the device hostname, even in situations where the machine is not actually a server.
112112

113113
Most SDKs will attempt to auto-discover this value.
114114

115115
</SdkOption>
116116

117-
<SdkOption name="autoSessionTracking">
117+
<SdkOption name="autoSessionTracking" type="bool" defaultValue="true">
118118

119119
When set to `true`, the SDK will send session events to Sentry. This is supported in all browser SDKs, emitting one session per pageload and page navigation to Sentry. In mobile SDKs, when the app goes to the background for longer than 30 seconds, sessions are ended.
120120

121121
</SdkOption>
122122

123-
<SdkOption name="considerInAppFramesByDefault">
123+
<SdkOption name="considerInAppFramesByDefault" type="bool">
124124

125125
Configures whether stack trace frames are considered as in app frames by default.
126126
You can use this to essentially make `inAppIncludes` or `inAppExcludes` an allow or deny list.
@@ -131,68 +131,68 @@ This value is used only if Sentry can not find the origin of the frame.
131131

132132
</SdkOption>
133133

134-
<SdkOption name="inAppInclude">
134+
<SdkOption name="inAppInclude" type="array">
135135

136136
A list of string prefixes of module names that belong to the app. This option takes precedence over `in-app-exclude`.
137137

138138
Sentry differentiates stack frames that are directly related to your application ("in application") from stack frames that come from other packages such as the standard library, frameworks, or other dependencies. The application package is automatically marked as `inApp`. The difference is visible in [sentry.io](https://sentry.io), where only the "in application" frames are displayed by default.
139139

140140
</SdkOption>
141141

142-
<SdkOption name="inAppExclude">
142+
<SdkOption name="inAppExclude" type="array">
143143

144144
A list of string prefixes of module names that do not belong to the app, but rather to third-party packages. Modules considered not part of the app will be hidden from stack traces by default.
145145

146146
This option can be overridden using <PlatformIdentifier name="inAppInclude" />.
147147

148148
</SdkOption>
149149

150-
<SdkOption name="attachScreenshot">
150+
<SdkOption name="attachScreenshot" type="bool" defaultValue="false">
151151

152152
Takes a screenshot of the application when an error happens and includes it as an attachment.
153153
Enable this option by setting <PlatformIdentifier name="attachScreenshot" /> to `true` and wrapping your root widget with `SentryWidget(child: MyApp())`.
154154
Learn more about enriching events with screenshots in our <PlatformLink to="/enriching-events/screenshots/">Screenshots documentation</PlatformLink>.
155155

156156
</SdkOption>
157157

158-
<SdkOption name="screenshotQuality">
158+
<SdkOption name="screenshotQuality" type="enum" defaultValue="high">
159159

160160
The quality of the attached screenshot. It can be set to `full`, `high`, `medium` or `low`.
161161

162162
</SdkOption>
163163

164-
<SdkOption name="attachViewHierarchy">
164+
<SdkOption name="attachViewHierarchy" type="bool" defaultValue="false">
165165

166166
Renders a JSON representation of the entire view hierarchy of the application when an error happens and includes it as an attachment.
167167
Learn more about enriching events with the view hierarchy in our <PlatformLink to="/enriching-events/viewhierarchy/">View Hierarchy documentation</PlatformLink>.
168168

169169
</SdkOption>
170170

171-
<SdkOption name="idleTimeout">
171+
<SdkOption name="idleTimeout" type="int" defaultValue="3000">
172172

173173
The idle time, measured in ms, to wait until a transaction will be automatically finished. The transaction will use the end timestamp of the last finished span as the endtime for the transaction.
174174

175175
The default is `3000`.
176176

177177
</SdkOption>
178178

179-
<SdkOption name="sendClientReports">
179+
<SdkOption name="sendClientReports" type="bool" defaultValue="true" availableSince="6.6.0">
180180

181181
Set this boolean to `false` to disable sending of client reports. Client reports are a protocol feature that let clients send status reports about themselves to Sentry. They are currently mainly used to emit outcomes for events that were never sent.
182182

183183
_(New in version 6.6.0)_
184184

185185
</SdkOption>
186186

187-
<SdkOption name="captureFailedRequests">
187+
<SdkOption name="captureFailedRequests" type="bool" defaultValue="true" availableSince="7.0.0">
188188

189189
Once enabled, this feature automatically captures HTTP client errors, like bad response codes, as error events and reports them to Sentry.
190190

191191
_(New in version 7.0.0)_
192192

193193
</SdkOption>
194194

195-
<SdkOption name="maxRequestBodySize">
195+
<SdkOption name="maxRequestBodySize" type="enum" defaultValue="never">
196196

197197
This parameter controls whether integrations should capture HTTP request bodies. It can be set to one of the following values:
198198

@@ -207,7 +207,7 @@ This parameter controls whether integrations should capture HTTP request bodies.
207207

208208
For many platform SDKs integrations can be configured alongside it. On some platforms that happen as part of the `init()` call, in some others, different patterns apply.
209209

210-
<SdkOption name="integrations">
210+
<SdkOption name="integrations" type="array">
211211

212212
In some SDKs, the integrations are configured through this parameter on library initialization. For more information, please see our documentation for a specific integration.
213213

@@ -217,15 +217,15 @@ In some SDKs, the integrations are configured through this parameter on library
217217

218218
These options can be used to hook the SDK in various ways to customize the reporting of events.
219219

220-
<SdkOption name="beforeSend">
220+
<SdkOption name="beforeSend" type="function">
221221

222222
This function is called with an SDK-specific message or error event object, and can return a modified event object, or `null` to skip reporting the event. This can be used, for instance, for manual PII stripping before sending.
223223

224224
By the time <PlatformIdentifier name="beforeSend" /> is executed, all scope data has already been applied to the event. Further modification of the scope won't have any effect.
225225

226226
</SdkOption>
227227

228-
<SdkOption name="beforeBreadcrumb">
228+
<SdkOption name="beforeBreadcrumb" type="function">
229229

230230
This function is called with an SDK-specific breadcrumb object before the breadcrumb is added to the scope. When nothing is returned from the function, the breadcrumb is dropped. To pass the breadcrumb through, return the first argument, which contains the breadcrumb object.
231231
The callback typically gets a second argument (called a "hint") which contains the original object from which the breadcrumb was created to further customize what the breadcrumb should look like.
@@ -236,27 +236,27 @@ The callback typically gets a second argument (called a "hint") which contains t
236236

237237
Transports are used to send events to Sentry. Transports can be customized to some degree to better support highly specific deployments.
238238

239-
<SdkOption name="transport">
239+
<SdkOption name="transport" type="function">
240240

241241
Switches out the transport used to send events. How this works depends on the SDK. It can, for instance, be used to capture events for unit-testing or to send it through some more complex setup that requires proxy authentication.
242242

243243
</SdkOption>
244244

245245
## Tracing Options
246246

247-
<SdkOption name="tracesSampleRate">
247+
<SdkOption name="tracesSampleRate" type="float">
248248

249249
A number between `0` and `1`, controlling the percentage chance a given transaction will be sent to Sentry. (`0` represents 0% while `1` represents 100%.) Applies equally to all transactions created in the app. Either this or <PlatformIdentifier name="tracesSampler" /> must be defined to enable tracing.
250250

251251
</SdkOption>
252252

253-
<SdkOption name="tracesSampler">
253+
<SdkOption name="tracesSampler" type="function">
254254

255255
A function responsible for determining the percentage chance a given transaction will be sent to Sentry. It will automatically be passed information about the transaction and the context in which it's being created, and must return a number between `0` (0% chance of being sent) and `1` (100% chance of being sent). Can also be used for filtering transactions, by returning 0 for those that are unwanted. Either this or <PlatformIdentifier name="tracesSampleRate" /> must be defined to enable tracing.
256256

257257
</SdkOption>
258258

259-
<SdkOption name="tracePropagationTargets">
259+
<SdkOption name="tracePropagationTargets" type="array">
260260

261261
An optional property that controls which downstream services receive tracing data, in the form of a `sentry-trace` and a `baggage` header attached to any outgoing HTTP requests.
262262

@@ -270,59 +270,59 @@ If <PlatformIdentifier name="tracePropagationTargets" /> is not provided, trace
270270

271271
## Experimental Features
272272

273-
<SdkOption name="experimental">
273+
<SdkOption name="experimental" type="object">
274274

275275
An optional property that configures which features are in experimental mode. This property is either an `Object Type` with properties or a key/value `TypedDict`, depending the language. Experimental features are still in-progress and may have bugs. We recognize the irony.
276276

277277
</SdkOption>
278278

279279
## Hybrid SDK Options
280280

281-
<SdkOption name="autoInitializeNativeSdk">
281+
<SdkOption name="autoInitializeNativeSdk" type="bool" defaultValue="true">
282282

283283
Set this boolean to `false` to disable the auto initialization of the native layer SDK. Doing so means you will need to initialize the native SDK manually. Do not use this to disable the native layer.
284284

285285
You should follow the [guide to native initialization](/platforms/dart/guides/flutter/native-init/) if you chose to use this option.
286286

287287
</SdkOption>
288288

289-
<SdkOption name="enableNativeCrashHandling">
289+
<SdkOption name="enableNativeCrashHandling" type="bool" defaultValue="true">
290290

291291
Set this boolean to `false` to disable hard crash handling from the native layer. Doing so means that the SDK won't capture events for hard crashes on Android and iOS if the error was caused by native code.
292292

293293
</SdkOption>
294294

295-
<SdkOption name="enableAutoSessionTracking">
295+
<SdkOption name="enableAutoSessionTracking" type="bool" defaultValue="true">
296296

297297
Set this boolean to `false` to disable the [release health](/product/releases/health/) feature.
298298

299299
</SdkOption>
300300

301-
<SdkOption name="sessionTrackingIntervalMillis">
301+
<SdkOption name="sessionTrackingIntervalMillis" type="int" defaultValue="30000">
302302

303303
Set this to change the default interval to end a session (release health) if the app goes to the background. Default is 30,000.
304304

305305
</SdkOption>
306306

307-
<SdkOption name="enableNdkScopeSync">
307+
<SdkOption name="enableNdkScopeSync" type="bool" defaultValue="true">
308308

309309
Set this boolean to `false` to disable the scope sync from Java to NDK on Android.
310310

311311
</SdkOption>
312312

313-
<SdkOption name="attachThreads">
313+
<SdkOption name="attachThreads" type="bool" defaultValue="false">
314314

315315
Set this boolean to `true` to automatically attach all threads to all logged events on Android.
316316

317317
</SdkOption>
318318

319-
<SdkOption name="enableAutoPerformanceTracing">
319+
<SdkOption name="enableAutoPerformanceTracing" type="bool" defaultValue="true">
320320

321321
Set this boolean to `false` to disable auto [tracing](/product/insights/overview/) tracking.
322322

323323
</SdkOption>
324324

325-
<SdkOption name="enableWatchdogTerminationTracking">
325+
<SdkOption name="enableWatchdogTerminationTracking" type="bool" defaultValue="true">
326326

327327
<Alert>
328328
Available since version 8.0.0 of Sentry Apple SDK. It was named
@@ -333,55 +333,55 @@ Set this boolean to `false` to disable [watchdog termination](/platforms/apple/g
333333

334334
</SdkOption>
335335

336-
<SdkOption name="enableScopeSync">
336+
<SdkOption name="enableScopeSync" type="bool" defaultValue="true">
337337

338338
Set this boolean to `false` to disable sync of `Scope` data to Android and iOS SDKs.
339339

340340
</SdkOption>
341341

342-
<SdkOption name="reportPackages">
342+
<SdkOption name="reportPackages" type="bool" defaultValue="true">
343343

344344
Set this boolean to `false` to disable reporting all the package dependencies.
345345

346346
</SdkOption>
347347

348-
<SdkOption name="anrEnabled">
348+
<SdkOption name="anrEnabled" type="bool" defaultValue="true">
349349

350350
Set this boolean to `true` to enable ANR (Application Not Responding) detection on Android.
351351

352352
</SdkOption>
353353

354-
<SdkOption name="anrTimeoutInterval">
354+
<SdkOption name="anrTimeoutInterval" type="int" defaultValue="5000">
355355

356356
Set this to change the default interval of the ANR detection. The default is `5` seconds.
357357

358358
</SdkOption>
359359

360-
<SdkOption name="reportSilentFlutterErrors">
360+
<SdkOption name="reportSilentFlutterErrors" type="bool" defaultValue="false">
361361

362362
Set this boolean to `true` to enable reporting [FlutterErrorDetails.silent](https://api.flutter.dev/flutter/foundation/FlutterErrorDetails/silent.html) errors automatically.
363363

364364
</SdkOption>
365365

366-
<SdkOption name="enableAutoNativeBreadcrumbs">
366+
<SdkOption name="enableAutoNativeBreadcrumbs" type="bool" defaultValue="true">
367367

368368
Set this boolean to `false` to disable automatic breadcrumbs on the Native platforms.
369369

370370
</SdkOption>
371371

372-
<SdkOption name="enableUserInteractionBreadcrumbs">
372+
<SdkOption name="enableUserInteractionBreadcrumbs" type="bool" defaultValue="true">
373373

374374
Set this boolean to `false` to disable automatic User Interactions breadcrumbs.
375375

376376
</SdkOption>
377377

378-
<SdkOption name="enableUserInteractionTracing">
378+
<SdkOption name="enableUserInteractionTracing" type="bool" defaultValue="true">
379379

380380
Set this boolean to `false` to disable automatic User Interactions tracing.
381381

382382
</SdkOption>
383383

384-
<SdkOption name="proguardUuid">
384+
<SdkOption name="proguardUuid" type="string">
385385

386386
Sets the Proguard UUID for Android platform
387387

0 commit comments

Comments
 (0)