Skip to content

Commit 6ac5ec5

Browse files
sfanahataShannon AnahataJoshuaMoelans
authored
SDKOtions migration (#15171)
## DESCRIBE YOUR PR Closing [Linear Project ](https://linear.app/getsentry/project/clean-up-configkey-vs-sdkoption-wrapper-clash-14536cd8ceee/overview) on the subject, this converts all `ConfigKey` styling to `SDKOption` styling. *Mobile SDKs* Android: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/android/configuration/options/ React Native: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/react-native/configuration/options/ Flutter: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/flutter/configuration/options/ Dart: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/dart/configuration/options/ *Apple Platforms* iOS: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/apple/guides/ios/configuration/options/ macOS: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/apple/guides/macos/configuration/options/ *Game Engines* Unity: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/unity/configuration/options/ Unity CLI Options: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/unity/configuration/options/cli-options/ Unity View Hierarchy: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/unity/enriching-events/view-hierarchy/ Unreal: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/unreal/configuration/options/ Godot: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/godot/configuration/options/ *Server SDKs* Java: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/java/configuration/options/ Kotlin Multiplatform: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/kotlin/guides/kotlin-multiplatform/configuration/options/ .NET: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/dotnet/configuration/options/ .NET MSBuild: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/dotnet/configuration/msbuild/ Native (C/C++): https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/native/configuration/options/ Elixir Logging: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/elixir/configuration/logging/ PowerShell: https://sentry-docs-git-sdkoptions-migration.sentry.dev/platforms/powershell/configuration/options/ *Contributor Documentation* Components Guide: https://sentry-docs-git-sdkoptions-migration.sentry.dev/contributing/pages/components/ Write Configuration Guide: https://sentry-docs-git-sdkoptions-migration.sentry.dev/contributing/approach/sdk-docs/write-configuration/ It also updates the instructions about styling for the docs repo. ## 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: JoshuaMoelans <[email protected]>
1 parent f0fad9b commit 6ac5ec5

File tree

20 files changed

+1037
-909
lines changed

20 files changed

+1037
-909
lines changed

docs/contributing/approach/sdk-docs/write-configuration.mdx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,29 @@ This file is `options.mdx`. It explains all the configuration options.
2828
To develop content for this file:
2929

3030
1. Create the `configuration/config-intro/` statement, which covers how options can be set.
31-
2. For individual options that the guide does NOT support, add the name of the guide to the `ConfigKey` statement for that option. This will prevent that option from displaying for this SDK. For example:
31+
2. Write option names in the platform's native casing:
32+
- **camelCase** for JavaScript/TypeScript, Java, Kotlin, Dart/Flutter, Android, Apple
33+
- **PascalCase** for .NET, Unity, Unreal, PowerShell
34+
- **snake_case** for Python, PHP, Ruby, Go, Rust, Elixir, Native (C/C++), Godot
35+
3. For individual options that certain platform categories do NOT support, use `categoryNotSupported` in the `SdkOption` statement. For example:
3236

33-
`<ConfigKey name="debug" notSupported={["javascript.react"]}>`
37+
`<SdkOption name="debug" type="boolean" defaultValue="false" categoryNotSupported={["browser"]}>`
3438

35-
Alternately, for individual options that the guide DOES support, add the name of the guide to `ConfigKey` statement for that option, which ensures the option displays. For example:
39+
Alternately, for individual options that only certain platform categories DO support, use `categorySupported` in the `SdkOption` statement. For example:
3640

37-
`<ConfigKey name="send-default-pii" supported={["javascript.electron", "javascript.ember"]}>`
41+
`<SdkOption name="sendDefaultPii" type="boolean" defaultValue="false" categorySupported={["server", "serverless"]}>`
3842

39-
3. For a grouping of options that the guide DOES support, add the name of the guide to the `PlatformSection` statement for those options, which ensures the option displays. For example:
43+
4. For guide-specific filtering (less common), use `PlatformSection` to wrap options that only apply to specific guides. For example:
4044

4145
`<PlatformSection supported={["javascript.react"]}>`
4246

47+
5. Add metadata where applicable:
48+
- `type` - the data type (e.g., `boolean`, `string`, `number`, `object`)
49+
- `defaultValue` - the default value
50+
- `envVar` - associated environment variable (if any)
51+
- `availableSince` - SDK version when introduced (if known)
52+
6. Add a `<TableOfContents ignoreIds={["core-options"]} />` at the top of the available options section for better navigation.
53+
4354
### Releases & Health
4455

4556
This file is `releases.mdx`. It explains how to configure the SDK to tell Sentry about releases. Provide a code sample for this SDK to set a release, then add the code sample to this directory:

docs/contributing/pages/components.mdx

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -255,30 +255,45 @@ function foo() {
255255
```
256256
````
257257

258-
## ConfigKey
258+
## SdkOption
259259

260-
Render a heading with a configuration key in the correctly cased format for a given platform.
260+
Render an SDK configuration option heading with a metadata table. Option names should be written in the platform's native casing (camelCase, PascalCase, or snake_case).
261261

262262
<Alert>
263263

264-
If content is specified, it will automatically hide the content when the given `platform` is not selected in context.
264+
If `categorySupported` is specified, it will automatically hide the option when the platform does not support it.
265265

266266
</Alert>
267267

268268
```markdown {tabTitle:Example}
269-
<ConfigKey name="send-default-pii" notSupported={["javascript"]}>
269+
<SdkOption
270+
name="sampleRate"
271+
type="number"
272+
defaultValue="1.0"
273+
envVar="SENTRY_SAMPLE_RATE">
270274

271-
Description of send-default-pii
275+
The sample rate for error events, as a number between `0.0` and `1.0` (inclusive).
272276

273-
</ConfigKey>
277+
</SdkOption>
274278
```
275279

276280
Attributes:
277281

278-
- `name` (string)
279-
- `platform` (string) - defaults to the `platform` value from the page context
280-
- `supported` (string[])
281-
- `notSupported` (string[])
282+
- `name` (string) - **required** - the option name in the platform's native casing
283+
- `type` (string) - optional - data type (e.g., `boolean`, `string`, `number`)
284+
- `defaultValue` (string) - optional - default value for the option
285+
- `envVar` (string) - optional - associated environment variable
286+
- `availableSince` (string) - optional - SDK version when the option was introduced
287+
- `categorySupported` (string[]) - optional - platform categories that support this option (e.g., `["browser", "server"]`)
288+
- `categoryNotSupported` (string[]) - optional - platform categories that don't support this option
289+
290+
**Platform-native casing guidelines:**
291+
292+
- **camelCase**: JavaScript/TypeScript (all frameworks), Java, Kotlin, Dart/Flutter, Android, Apple (iOS/macOS)
293+
- **PascalCase**: .NET (all frameworks), Unity, Unreal, PowerShell
294+
- **snake_case**: Python, PHP, Ruby, Go, Rust, Elixir, Native (C/C++), Godot
295+
296+
Use the `<PlatformIdentifier name="option-name" />` component to render option names with correct casing based on the platform's `case_style` setting.
282297

283298
## PageGrid
284299

0 commit comments

Comments
 (0)