bugsnag / bugsnag-wordpress

BugSnag error monitoring for WordPress sites
http://wordpress.org/plugins/bugsnag/
GNU General Public License v2.0
20 stars 15 forks source link

Feature Request: Incorporate JS Bugsnag Library #21

Open mikebronner opened 7 years ago

mikebronner commented 7 years ago

Would love to see this plugin also inject the JS error handling, with a separate bugsnag API key for the JS bugsnag project (would of course require setup of two bugsnag projects).

This would dramatically ease the implementation of JS monitoring on Wordpress websites.

Thoughts?

Cawllec commented 6 years ago

Hi @mikebronner, sorry it's taken so long to get to this.

This is absolutely something that we can look into doing. I'll note back any progress here.

mikebronner commented 6 years ago

Thanks, I'm still very much interested in this :)

simplenotezy commented 5 years ago

Me too, any updates?

abigailbramble commented 4 years ago

You can manually add the JS library to your site by following our JS integration guide. We are still considering building this into the Wordpress Plugin. We will provide updates when that happens but we do not have an ETA as yet.

masteradhoc commented 1 year ago

+1 would be amazing to get that into the plugin @imjoehaines any idea if this could get worked on soon?

luke-belton commented 1 year ago

Hi @masteradhoc - this is still on our product roadmap, but I don't currently have an ETA for when we might work on this. We'll make sure we keep this thread updated with any progress 👍

masteradhoc commented 1 year ago

@luke-belton Any update half a year later? :)

johnkiely1 commented 1 year ago

Hi @masteradhoc, unfortunately we don't have any updates to share. This is still on the backlog and we haven't had a chance to work on it yet.

bhubbard commented 9 months ago

Can we get movement on this it really should not be that difficult, here is code:

 function bugsnag_enqueue_js() {
    wp_enqueue_script( 'bugsnag', 'https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js', array(), '7', true );
    wp_enqueue_script( 'bugsnag-performance', 'https://d2wy8f7a9ursnm.cloudfront.net/v2.1.0/bugsnag-performance.min.js', array('bugsnag'), '2.1.0', true ); // Performance JS File, Optional.
        wp_add_inline_script( 'bugsnag', 'Bugsnag.start({
  apiKey: \'API-KEY-GOES-HERE\'
})' );
 }
add_action( 'wp_enqueue_scripts', 'bugsnag_enqueue_js' );
add_action( 'admin_enqueue_scripts', 'bugsnag_enqueue_js' ); // Load on Admin Pages, Should be an option.

You can use wp_localize_script to send the API Key to the inline script code.

mclack commented 8 months ago

Hi @bhubbard

We appreciate your patience here.

This is something that has been discussed internally, but a real integration would require a way to pass config between both of the notifiers, and this isn't currently something we're looking to directly support in the near future.

If you're keen to incorporate the current solution you have, then please feel free to make a new plugin that only pulls in bugsnag-js. Or you could fork the repo, apply the change and follow the manual instructions for installation.