Skip to content

Commit 14fe05d

Browse files
misc: Add sentry.options.json example to the changelog (#4509)
1 parent 95c36ef commit 14fe05d

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,44 @@
88
99
## Unreleased
1010

11+
### Features
12+
13+
- Capture App Start errors and crashes by initializing Sentry from `sentry.options.json` ([#4472](https://github.com/getsentry/sentry-react-native/pull/4472))
14+
15+
Create `sentry.options.json` in the React Native project root and set options the same as you currently have in `Sentry.init` in JS.
16+
17+
```json
18+
{
19+
"dsn": "https://key@example.io/value",
20+
}
21+
```
22+
23+
Initialize Sentry on the native layers by newly provided native methods.
24+
25+
```kotlin
26+
import io.sentry.react.RNSentrySDK
27+
28+
class MainApplication : Application(), ReactApplication {
29+
override fun onCreate() {
30+
super.onCreate()
31+
RNSentrySDK.init(this)
32+
}
33+
}
34+
```
35+
36+
```obj-c
37+
#import <RNSentry/RNSentry.h>
38+
39+
@implementation AppDelegate
40+
- (BOOL)application:(UIApplication *)application
41+
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
42+
{
43+
[RNSentrySDK start];
44+
return [super application:application didFinishLaunchingWithOptions:launchOptions];
45+
}
46+
@end
47+
```
48+
1149
### Changes
1250
1351
- Load `optionsFile` into the JS bundle during Metro bundle process ([#4476](https://github.com/getsentry/sentry-react-native/pull/4476))

0 commit comments

Comments
 (0)