call @sentry/angular-ivy and @sentry/react ? #9188
-
hello we at the moment are migrating our angular application to react and we do wonder if we can init both sdks like this:
or should this be a little bit different? |
Beta Was this translation helpful? Give feedback.
Answered by
AbhiPrasad
Oct 6, 2023
Replies: 1 comment
-
Hey! I would not recommend initializing both SDKs - they will conflict with each other. I would initialize the react SDK, and only use the // main.ts
import {Replay as SentryReactReplay, init as reactInit} from '@sentry/react';
reactInit({
dsn: __PUBLIC_DSN__,
integrations: [new SentryReactReplay()],
// Capture Replay for 10% of all sessions,
// plus for 100% of sessions with an error
replaysSessionSampleRate: 0.0,
replaysOnErrorSampleRate: 1.0,
}); // app.module.ts
import { NgModule, ErrorHandler } from "@angular/core";
import * as Sentry from "@sentry/angular-ivy";
@NgModule({
// ...
providers: [
{
provide: ErrorHandler,
useValue: Sentry.createErrorHandler(),
},
],
// ...
});
export class AppModule {} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
schmitch
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey! I would not recommend initializing both SDKs - they will conflict with each other.
I would initialize the react SDK, and only use the
ErrorHandler
andTraceService
from the Angular SDK.