bugsnag-wordpress icon indicating copy to clipboard operation
bugsnag-wordpress copied to clipboard

Feature Request: Incorporate JS Bugsnag Library

Open mikebronner opened this issue 8 years ago • 10 comments

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?

mikebronner avatar Apr 14 '17 19:04 mikebronner

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.

Cawllec avatar Apr 16 '18 14:04 Cawllec

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

mikebronner avatar Apr 16 '18 15:04 mikebronner

Me too, any updates?

simplenotezy avatar Sep 12 '19 12:09 simplenotezy

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.

abigailbramble avatar Sep 25 '19 08:09 abigailbramble

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

masteradhoc avatar Jan 26 '23 09:01 masteradhoc

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 👍

luke-belton avatar Jan 26 '23 14:01 luke-belton

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

masteradhoc avatar Jul 17 '23 18:07 masteradhoc

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.

johnkiely1 avatar Jul 19 '23 10:07 johnkiely1

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.

bhubbard avatar Dec 13 '23 17:12 bhubbard

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.

mclack avatar Jan 02 '24 14:01 mclack