Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(config) {
if (config instanceof Configuration) {
this.config = config;
} else {
this.config = new Configuration(config);
}
this.config.setPlatform(Platform.OS);
this.rollbar = new Rollbar(this.config.toJSON());
if (NativeClient) {
NativeClient.init(this.config.toJSON());
this.captureUncaughtExceptions();
if (this.config.captureUnhandledRejections) {
this.captureUnhandledRejections();
}
} else {
throw new Error('Rollbar: Native client not found. Did you run react-native link?');
}
}