Regarding accessing sentry with enable and disable switch #2789
              
                Unanswered
              
          
                  
                    
                      venkat9507
                    
                  
                
                  asked this question in
                Q&A
              
            Replies: 1 comment 8 replies
-
| The recommendation is to initialize as early in the app's lifecycle as possible. From the top of my head some instrumentation will be wrong such as app start but for normal error reporting it shouldn't be a problem. However it is still not a supported use case so we can't make guarantees that it will work flawlessly If you want to 'disable' and 're-enable' Sentry during runtime I'd rather suggest to use  options.beforeSend = (event, hint) {
  // only send events if enabled
  if (enable) {
    return event;
  } else {
    return null;
  }
} | 
Beta Was this translation helpful? Give feedback.
                  
                    8 replies
                  
                
            
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
is this above is possible with sentry do we want to integrate sentry only in main.dart or else in run time we can enable sentry because in official sentry docs they mentioned as in main.dart only so if we enable it in some other place in run time will it cause any issue?
Beta Was this translation helpful? Give feedback.
All reactions