|
| 1 | +--- |
| 2 | +title: Migration Guide |
| 3 | +description: "Learn more about migrating to the current version." |
| 4 | +sidebar_order: 8000 |
| 5 | +--- |
| 6 | + |
| 7 | +## Migrating to 1.0.0 |
| 8 | + |
| 9 | +### Breaking changes |
| 10 | + |
| 11 | +The minimum supported Godot Engine version has been updated to `4.5-stable`. This requirement will remain fixed for the `1.x` release series. The log file is no longer required for script error detection. |
| 12 | + |
| 13 | +We redesigned breadcrumbs API for a cleaner interface. See [Changes to breadcrumbs API](#changes-to-breadcrumbs-api) below. |
| 14 | + |
| 15 | +Configuration script support and `SentryConfiguration` class are removed. Instead, please use manual initialization with a configuration callback, if you need to set up SDK from code. See [Changes to programmatic configuration](#changes-to-programmatic-configuration) below. |
| 16 | + |
| 17 | +The `attach_screenshot` and `screenshot_level` options have moved to the experimental section while we're still improving things. If you previously had it enabled, you will need to re-enable it in its new location. Testing is recommended if you want to use this in production. |
| 18 | + |
| 19 | +`enabled` and `disabled_in_editor_play` project settings were renamed to `auto_init` and `skip_auto_init_on_editor_play` for clarity. |
| 20 | + |
| 21 | + |
| 22 | +### Changes to breadcrumbs API |
| 23 | + |
| 24 | +Previously, `add_breadcrumb()` method accepted 5 parameters (3 of which were strings), making it confusing to use. The new approach uses a dedicated `SentryBreadcrumb` class: |
| 25 | + |
| 26 | +```gdscript |
| 27 | +var crumb := SentryBreadcrumb.create("Something happened") |
| 28 | +crumb.type = "info" |
| 29 | +crumb.set_data({"some": "data"}) |
| 30 | +SentrySDK.add_breadcrumb(crumb) |
| 31 | +``` |
| 32 | + |
| 33 | +For simple breadcrumbs, you can use a one-liner: |
| 34 | +```gdscript |
| 35 | +SentrySDK.add_breadcrumb(SentryBreadcrumb.create("Something happened")) |
| 36 | +``` |
| 37 | + |
| 38 | +### Changes to programmatic configuration |
| 39 | + |
| 40 | +Configuration scripts and the `SentryConfiguration` class have been removed. To configure the SDK programmatically, you must initialize it manually. The earliest point for initialization is within the `MainLoop._initialize()` method. Here's how you can do it: |
| 41 | + |
| 42 | +1. Disable **Auto Init** in Godot's **Project Settings** window under **Sentry** category. |
| 43 | +2. Create a main loop script with a `class_name` attribute, and init Sentry inside `_initialize()` method. |
| 44 | +```gdscript |
| 45 | +class_name MyMainLoop |
| 46 | +extends SceneTree |
| 47 | +
|
| 48 | +func _initialize() -> void: |
| 49 | + # Sentry initialization |
| 50 | + SentrySDK.init(func(options: SentryOptions) -> void: |
| 51 | + options.release = "[email protected]" |
| 52 | + options.before_send = _before_send |
| 53 | + ) |
| 54 | +
|
| 55 | + # Post-init configuration |
| 56 | + SentrySDK.add_attachment(...) |
| 57 | + # ... |
| 58 | +
|
| 59 | +func _before_send(ev: SentryEvent) -> SentryEvent: |
| 60 | + # Return the event (with or without modifications) or null to skip reporting. |
| 61 | + return ev |
| 62 | +``` |
| 63 | +3. Assign your main loop type in Godot's **Project Settings** under **Application > Run > Main Loop Type** ("MyMainLoop" in the example code). |
0 commit comments