Skip to content

call @sentry/angular-ivy and @sentry/react ? #9188

Answered by AbhiPrasad
schmitch asked this question in Q&A
Discussion options

You must be logged in to vote

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 and TraceService from the Angular SDK.

// 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: E…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by schmitch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants