Skip to content

Godot: Synchronize documentation with latest changes #13824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions docs/platforms/godot/configuration/options.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Specifies the types of errors captured as breadcrumbs. Accepts a single value or
- `MASK_SCRIPT`: Script errors will be captured.
- `MASK_SHADER`: Shader errors will be captured.

```gdscript
```GDScript
var mask = SentryOptions.MASK_ERROR | SentryOptions.MASK_SCRIPT
options.logger_breadcrumb_mask = mask
```
Expand All @@ -138,7 +138,7 @@ options.logger_breadcrumb_mask = mask

Specifies the types of errors captured as events. Accepts a single value or a bitwise combination of `GodotErrorMask` masks.

```gdscript
```GDScript
var mask = SentryOptions.MASK_ERROR | SentryOptions.MASK_SCRIPT
options.logger_event_mask = mask
```
Expand Down Expand Up @@ -178,7 +178,7 @@ thread-safe APIs and only use Godot-specific APIs after you've checked that you'

If assigned, this callback runs before a message or error event is sent to Sentry. It takes `SentryEvent` as a parameter and returns either the same event object, with or without modifications, or `null` to skip reporting the event. You can assign it in a [configuration script](#configuration-script). This can be used, for instance, for stripping PII before sending.

```gdscript
```GDScript
func _before_send(event: SentryEvent) -> SentryEvent:
if event.environment.contains("editor"):
# Discard event if running from the editor.
Expand All @@ -191,19 +191,15 @@ func _before_send(event: SentryEvent) -> SentryEvent:

</ConfigKey>

<ConfigKey name="on-crash">
<ConfigKey name="before-capture-screenshot">

If assigned, this callback runs before a crash event is sent to Sentry. In contrast to `before_send`, it is only called when a crash occurred. It takes `SentryEvent` as a parameter and returns either the same event object, with or without modifications, or `null` to skip reporting the event. You can assign it in a [configuration script](#configuration-script).
If assigned, this callback runs before a screenshot is captured. It takes `SentryEvent` as a parameter and returns `false` to skip capturing the screenshot, or `true` to capture the screenshot.

```gdscript
func _on_crash(event: SentryEvent) -> SentryEvent:
if event.environment.contains("editor"):
# Discard event if running from the editor.
return null
if event.message.contains("Bruno"):
# Remove sensitive information from the event.
event.message = event.message.replace("Bruno", "REDACTED")
return event
```GDScript
func _before_capture_screenshot(event: SentryEvent) -> bool:
if is_showing_sensitive_info():
return false # Don't capture screenshot!
return true
```

</ConfigKey>
2 changes: 1 addition & 1 deletion docs/platforms/godot/configuration/stack-traces.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ For more information, refer to [Sentry CLI](/cli/) documentation.
You can also upload debug files for the Sentry SDK itself by running the following command from your project directory:

```bash {tabTitle:Bash/PowerShell}
sentry-cli debug-files upload --org ___ORG_SLUG___ --project ___PROJECT_SLUG___ addons/sentrysdk/
sentry-cli debug-files upload --org ___ORG_SLUG___ --project ___PROJECT_SLUG___ addons/sentry/
```

This uploads the SDK's debug files to Sentry. You can repeat this step for any other native extension used in your Godot project.
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/capture-message/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```gdscript
```GDScript
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the syntax highlighting token because of casing? if not this change is more noise then value on this PR

Copy link
Collaborator Author

@limbonaut limbonaut May 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm changing it, because in the tab it shows Gdscript which is incorrect -- it should show GDScript.

SentrySDK.capture_message("Something went wrong")
```
7 changes: 3 additions & 4 deletions platform-includes/configuration/before-send/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
```gdscript
```GDScript
extends SentryConfiguration
## Tip: Assign configuration script in the Project Settings.

func _configure(options: SentryOptions):
options.before_send = _process_event
options.on_crash = _process_event
options.before_send = _before_send

func _process_event(event: SentryEvent) -> SentryEvent:
func _before_send(event: SentryEvent) -> SentryEvent:
if event.environment == "debug":
# Discard event if running in a debug build.
return null
Expand Down
7 changes: 3 additions & 4 deletions platform-includes/configuration/config-intro/godot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@ Options are used to initialize and control the behavior of the SDK. They can be

To define a configuration script, create a new script that extends the `SentryConfiguration` class. Then, assign your configuration script in the **Project Settings** under the **Sentry** category in the `Configuration Script` field.

```gdscript
```GDScript
extends SentryConfiguration

func _configure(options: SentryOptions):
if OS.is_debug_build():
options.environment = "debug"
options.debug = true
options.release = "[email protected]"
options.before_send = _process_event
options.on_crash = _process_event
options.before_send = _before_send

func _process_event(event: SentryEvent) -> SentryEvent:
func _before_send(event: SentryEvent) -> SentryEvent:
if event.environment == "debug":
# Discard event if running in a debug build.
return null
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/configuration/sample-rate/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
extends SentryConfiguration
## Tip: Assign configuration script in the Project Settings.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
var message := "Player respawned"
var category := "gameplay"
var level := SentrySDK.LEVEL_INFO
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/enriching-events/set-context/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
SentrySDK.set_context(
"ship",
{
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/enriching-events/set-tag/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```gdscript
```GDScript
SentrySDK.set_tag("biome", "jungle");
```
2 changes: 1 addition & 1 deletion platform-includes/enriching-events/set-user/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
var user := SentryUser.new()
user.generate_new_id()
user.infer_ip_address()
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/enriching-events/unset-user/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```gdscript
```GDScript
SentrySDK.remove_user()
```
4 changes: 2 additions & 2 deletions platform-includes/getting-started-install/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Download the latest stable version `{{@inject packages.version('sentry.godot', '?') }}` from [GitHub Releases](https://github.com/getsentry/sentry-godot/releases/). The archive includes the Sentry SDK addon and a demo project. You can either extract the entire archive into a separate folder to open the demo in Godot Engine or extract only `addons/sentrysdk` into existing project.
Download the latest stable version `{{@inject packages.version('sentry.godot', '?') }}` from [GitHub Releases](https://github.com/getsentry/sentry-godot/releases/). The archive includes the Sentry SDK addon and a demo project. You can either extract the entire archive into a separate folder to open the demo in Godot Engine or extract only `addons/sentry` into existing project.

<Alert>

Ensure that the addon is placed exactly as it is in the demo project, in the `addons/sentrysdk` folder, preserving the exact casing.
Ensure that the addon is placed exactly as it is in the demo project, in the `addons/sentry` folder, preserving the exact casing.

</Alert>
2 changes: 1 addition & 1 deletion platform-includes/getting-started-primer/godot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Our SDK for Godot Engine builds on top of existing Sentry SDKs, extending them w
- Capture Godot errors, such as script and shader error
- Adding surrounding script source code if available
- Throttling options for spammy errors
- Filter and customize events in `before_send` and `on_crash` callbacks (in GDScript)
- Filter and customize events in `before_send` callback (in GDScript)
- Attachment support for Godot logs
- Information about user configuration like GPU, CPU, platform and such
- Configure options in Project Settings and/or in GDScript
2 changes: 1 addition & 1 deletion platform-includes/getting-started-verify/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
extends Node

func _ready():
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/sensitive-data/set-tag/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```gdscript
```GDScript
SentrySDK.set_tag("birthday", str("08/12/1990".hash()))
```
2 changes: 1 addition & 1 deletion platform-includes/sensitive-data/set-user/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
# Assuming client_user is an Object containing user data.
var user := SentryUser.new()
user.id = client_user.id
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/set-environment/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
extends SentryConfiguration
## Tip: Assign configuration script in the Project Settings.

Expand Down
2 changes: 1 addition & 1 deletion platform-includes/set-level/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
var event = SentrySDK.create_event()
event.level = SentrySDK.LEVEL_WARNING
SentrySDK.capture_event(event)
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/set-release/godot.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
```gdscript
```GDScript
extends SentryConfiguration
## Tip: Assign configuration script in the Project Settings.

Expand Down