Browser JS

How to configure Rollbar.js to work in the browser | Support Level: Supported

📘

For help with importing or requiring Rollbar into your project with Typescript or a version of ECMAScript (ES5/ES6/ES7/ES8/ES9), please see this document here.

This is the recommendation for the majority of modern web applications as most applications use a bundler and modules have made their way through standards and are available in all modern browsers.

Quick Start

Copy-paste the following code into the <head> of every page you want to monitor. It should be as high as possible, before any other <script> tags.

Be sure to replace POST_CLIENT_ITEM_ACCESS_TOKEN with your project's post_client_item access token, which you can find in the Rollbar.com interface. You can find this by going to your project's Settings > Project Access Tokens.

<script>
var _rollbarConfig = {
    accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN",
    captureUncaught: true,
    captureUnhandledRejections: true,
    payload: {
        environment: "production",
        //trace_id: 'abc',
        client: {
            javascript: {
                code_version: '1.0.0',
                //source_map_enabled: true,
                //guess_uncaught_frames: true
            }
        },
        //server: {
            //root: 'http://localhost:8000/demo/',
            //host: 'host-1',
            //branch: 'HEAD',
        //},
    }
};
// Rollbar Snippet
!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.26.4/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=a((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||function(r){return!("object"!=typeof r||void 0!==r.page&&!r.page)}(a))&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports=function(r,e,o){if(r){var t,a,l="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);
// End Rollbar Snippet
</script>

If you're running Rollbar on an environment besides production, change the environment value to something else (e.g. staging). See more configuration options here.

Test your installation

  1. Navigate your browser to a page that has the above code installed
  2. Type the following code into the console and press enter: window.onerror("TestRollbarError: testing window.onerror", window.location.href)

If you're on Firefox, window.onerror is not accessible from the console, so you'll need to try this in your code instead: setTimeout(function() {notThere();}, 1000);.

This simulates an uncaught error. It should appear in your project's dashboard within a few seconds.

📘

For more information on rollbar.js, please see the docs here.


UMD

rollbar.js is also distributed using UMD, so you can use it with browserify, requirejs, webpack, or anything else that uses AMD or CommonJS modules. See the examples for details.



\n```\n\nIf you're running Rollbar on an environment besides production, change the `environment` value to something else (e.g. `staging`). See more configuration options [here](https://docs.rollbar.com/docs/rollbarjs-configuration-reference).\n\n### Test your installation\n\n1. Navigate your browser to a page that has the above code installed\n2. Type the following code into the console and press enter: `window.onerror(\"TestRollbarError: testing window.onerror\", window.location.href)`\n\nIf you're on Firefox, `window.onerror` is not accessible from the console, so you'll need to try this in your code instead: `setTimeout(function() {notThere();}, 1000);`.\n\nThis simulates an uncaught error. It should appear in your project's dashboard within a few seconds.\n\n### [Updating your SDK](https://docs.rollbar.com/docs/javascript#upgrading-from-previous-versions)\n\n> 📘 \n> \n> For more information on rollbar.js, please see the docs [here](https://docs.rollbar.com/v1.0.0/docs/javascript).\n\n
\n\n### UMD\n\nrollbar.js is also distributed using UMD, so you can use it with browserify, requirejs, webpack, or anything else that uses AMD or CommonJS modules. See the [examples](https://github.com/rollbar/rollbar.js/tree/master/examples) for details.\n\n
","dehydrated":{"toc":"","body":"

📘

For help with importing or requiring Rollbar into your project with Typescript or a version of ECMAScript (ES5/ES6/ES7/ES8/ES9), please see this document here.

This is the recommendation for the majority of modern web applications as most applications use a bundler and modules have made their way through standards and are available in all modern browsers.

\n

Quick Start

\n

Copy-paste the following code into the <head> of every page you want to monitor. It should be as high as possible, before any other <script> tags.

\n

Be sure to replace POST_CLIENT_ITEM_ACCESS_TOKEN with your project's post_client_item access token, which you can find in the Rollbar.com interface. You can find this by going to your project's Settings > Project Access Tokens.

\n
<script>\nvar _rollbarConfig = {\n    accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN",\n    captureUncaught: true,\n    captureUnhandledRejections: true,\n    payload: {\n        environment: "production",\n        //trace_id: 'abc',\n        client: {\n            javascript: {\n                code_version: '1.0.0',\n                //source_map_enabled: true,\n                //guess_uncaught_frames: true\n            }\n        },\n        //server: {\n            //root: 'http://localhost:8000/demo/',\n            //host: 'host-1',\n            //branch: 'HEAD',\n        //},\n    }\n};\n// Rollbar Snippet\n!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.26.4/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=a((function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;i<a.length;++i)if("function"==typeof(l=a[i])){l(e);break}}"function"==typeof t&&t(e)}()}})),d.insertBefore(i,s)},i.prototype.wrap=function(r,e,o){try{var n;if(n="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._rollbar_wrapped&&(r._rollbar_wrapped=function(){o&&"function"==typeof o&&o.apply(this,arguments);try{return r.apply(this,arguments)}catch(o){var e=o;throw e&&("string"==typeof e&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e),e}},r._rollbar_wrapped._isWrap=!0,r.hasOwnProperty))for(var t in r)r.hasOwnProperty(t)&&(r._rollbar_wrapped[t]=r[t]);return r._rollbar_wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),f=0;f<p.length;++f)i.prototype[p[f]]=u(p[f]);r.exports={setupShim:function(r,e){if(r){var o=e.globalAlias||"Rollbar";if("object"==typeof r[o])return r[o];r._rollbarShims={},r._rollbarWrappedError=null;var l=new c(e);return a((function(){e.captureUncaught&&(l._rollbarOldOnError=r.onerror,n.captureUncaughtExceptions(r,l,!0),e.wrapGlobalEventHandlers&&t(r,l,!0)),e.captureUnhandledRejections&&n.captureUnhandledRejections(r,l,!0);var a=e.autoInstrument;return!1!==e.enabled&&(void 0===a||!0===a||function(r){return!("object"!=typeof r||void 0!==r.page&&!r.page)}(a))&&r.addEventListener&&(r.addEventListener("load",l.captureLoad.bind(l)),r.addEventListener("DOMContentLoaded",l.captureDomContentLoaded.bind(l))),r[o]=l,l}))()}},Rollbar:c}},function(r,e,o){"use strict";function n(r,e,o,n){r._rollbarWrappedError&&(n[4]||(n[4]=r._rollbarWrappedError),n[5]||(n[5]=r._rollbarWrappedError._rollbarContext),r._rollbarWrappedError=null);var t=e.handleUncaughtException.apply(e,n);o&&o.apply(r,n),"anonymous"===t&&(e.anonymousErrorsPending+=1)}r.exports={captureUncaughtExceptions:function(r,e,o){if(r){var t;if("function"==typeof e._rollbarOldOnError)t=e._rollbarOldOnError;else if(r.onerror){for(t=r.onerror;t._rollbarOldOnError;)t=t._rollbarOldOnError;e._rollbarOldOnError=t}e.handleAnonymousErrors();var a=function(){var o=Array.prototype.slice.call(arguments,0);n(r,e,t,o)};o&&(a._rollbarOldOnError=t),r.onerror=a}},captureUnhandledRejections:function(r,e,o){if(r){"function"==typeof r._rollbarURH&&r._rollbarURH.belongsToShim&&r.removeEventListener("unhandledrejection",r._rollbarURH);var n=function(r){var o,n,t;try{o=r.reason}catch(r){o=void 0}try{n=r.promise}catch(r){n="[unhandledrejection] error getting `promise` from event"}try{t=r.detail,!o&&t&&(o=t.reason,n=t.promise)}catch(r){}o||(o="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(o,n)};n.belongsToShim=o,r._rollbarURH=n,r.addEventListener("unhandledrejection",n)}}}},function(r,e,o){"use strict";function n(r,e,o){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){for(var n=e.addEventListener;n._rollbarOldAdd&&n.belongsToShim;)n=n._rollbarOldAdd;var t=function(e,o,t){n.call(this,e,r.wrap(o),t)};t._rollbarOldAdd=n,t.belongsToShim=o,e.addEventListener=t;for(var a=e.removeEventListener;a._rollbarOldRemove&&a.belongsToShim;)a=a._rollbarOldRemove;var l=function(r,e,o){a.call(this,r,e&&e._rollbar_wrapped||e,o)};l._rollbarOldRemove=a,l.belongsToShim=o,e.removeEventListener=l}}r.exports=function(r,e,o){if(r){var t,a,l="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(t=0;t<l.length;++t)r[a=l[t]]&&r[a].prototype&&n(e,r[a].prototype,o)}}},function(r,e,o){"use strict";function n(r,e){this.impl=r(e,this),this.options=e,function(r){for(var e=function(r){return function(){var e=Array.prototype.slice.call(arguments,0);if(this.impl[r])return this.impl[r].apply(this.impl,e)}},o="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleAnonymousErrors,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<o.length;n++)r[o[n]]=e(o[n])}(n.prototype)}n.prototype._swapAndProcessMessages=function(r,e){var o,n,t;for(this.impl=r(this.options);o=e.shift();)n=o.method,t=o.args,this[n]&&"function"==typeof this[n]&&("captureDomContentLoaded"===n||"captureLoad"===n?this[n].apply(this,[t[0],o.ts]):this[n].apply(this,t));return this},r.exports=n},function(r,e,o){"use strict";r.exports=function(r){return function(e){if(!e&&!window._rollbarInitialized){for(var o,n,t=(r=r||{}).globalAlias||"Rollbar",a=window.rollbar,l=function(r){return new a(r)},i=0;o=window._rollbarShims[i++];)n||(n=o.handler),o.handler._swapAndProcessMessages(l,o.messages);window[t]=n,window._rollbarInitialized=!0}}}}]);\n// End Rollbar Snippet\n</script>\n
\n

If you're running Rollbar on an environment besides production, change the environment value to something else (e.g. staging). See more configuration options here.

\n

Test your installation

\n
    \n
  1. Navigate your browser to a page that has the above code installed
  2. \n
  3. Type the following code into the console and press enter: window.onerror("TestRollbarError: testing window.onerror", window.location.href)
  4. \n
\n

If you're on Firefox, window.onerror is not accessible from the console, so you'll need to try this in your code instead: setTimeout(function() {notThere();}, 1000);.

\n

This simulates an uncaught error. It should appear in your project's dashboard within a few seconds.

\n

\n

📘

For more information on rollbar.js, please see the docs here.

\n
\n

UMD

\n

rollbar.js is also distributed using UMD, so you can use it with browserify, requirejs, webpack, or anything else that uses AMD or CommonJS modules. See the examples for details.

\n
"},"mdx":false,"opts":{"alwaysThrow":false,"compatibilityMode":false,"copyButtons":true,"correctnewlines":false,"markdownOptions":{"fences":true,"commonmark":true,"gfm":true,"ruleSpaces":false,"listItemIndent":"1","spacedTable":true,"paddedTable":true},"normalize":true,"lazyImages":true,"reusableContent":{"tags":{}},"safeMode":false,"settings":{"position":true},"theme":"light","customBlocks":{},"resourceID":"5b3a2848b59ff40003acf831","resourceType":"page","baseUrl":"/","terms":[],"variables":{"user":{},"defaults":[]}},"terms":[],"variables":{"user":{},"defaults":[]}},"doc":{"metadata":{"image":[],"title":"","description":"","keywords":"","robots":"index"},"mdx":{"altBody":"","status":"rdmd"},"api":{"results":{"codes":[{"status":200,"language":"json","code":"{}","name":""},{"status":400,"language":"json","code":"{}","name":""}]},"auth":"required","params":[],"url":"","method":"get","examples":{"codes":[]}},"next":{"pages":[],"description":""},"algolia":{"publishPending":false,"recordCount":5,"updatedAt":"2024-04-30T15:46:17.123Z","translationFailure":false},"_id":"5b3a2848b59ff40003acf831","version":{"pdfStatus":"","source":"readme","_id":"5a876b07d24de400828cb2fd","project":"5a874ae082fdd5001282c796","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","categories":["5a876b07d24de400828cb2fe","5a876b08d24de400828cb2ff","5a876bcc82fdd5001282cb7c","5a876dd482fdd5001282cbc9","5a876e38ca7829001221eed7","5a876eec82fdd5001282cbcb","5a8f662968264c001f20c132","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","5a8f669228fe2b00125ffcff","5a8f66b628fe2b00125ffd00","5a8f66bd6b00510012de6359","5a8f66d025969d0012bc6066","5a8f693228fe2b00125ffd9c","5a90738f86916d001246342a","5a9073fb86916d00124634cc","5a90743a0a654e0033505444","5a9074400a654e0033505447","5a90825f86916d0012464674","5a9087cb0e4768001effa968","5a90882c3f89a0007db28867","5a9088a786916d00124647d0","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","5a90a2d986916d0012464cc1","5a90ae27da282100121ced2c","5a96083af8f5d70012898e10","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","5aa6fed212c154001231834e","5aeb60063566c8000349b694","5aecbfbfa4c4a200035958bd","5e04c66822bb70006bea3964","5e04ec186c2c3d005d59a743","5e14f0a9f303bb0018c74ac4","6192be6557fe57000f5aaba8","62dca6181f36f8002e0baccb","62de9e06fd51710021a7e872","62de9e1b6316c304034d006b","62dea06d88d21700a1234a48","6376b422081e400003bac42f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0","__v":35,"apiRegistries":[]},"project":"5a874ae082fdd5001282c796","category":{"_id":"5a876b08d24de400828cb2ff","project":"5a874ae082fdd5001282c796","version":"5a876b07d24de400828cb2fd","isAPI":false,"reference":false,"createdAt":"2018-02-16T23:36:40.001Z","from_sync":false,"order":1,"slug":"sdks","title":"Languages and Frameworks","__v":0,"type":"guide","id":"5a876b08d24de400828cb2ff"},"user":"63cda809dc634b004444cd70","parentDoc":"5a909ae10e4768001effac02","updates":["5b58e29c4d81fe0003d77316","6152cda9fad40d0063127486","6234f17ca06046004a95d058","62467b99d4875c02dddd6667","624c382a631fa6003956882a","62598ac54b9d7c008b053a04"],"createdAt":"2018-07-02T13:27:36.987Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"isReference":false,"order":0,"body":"> 📘 \n> \n> For help with importing or requiring Rollbar into your project with Typescript or a version of ECMAScript (ES5/ES6/ES7/ES8/ES9), please see this document [here.](https://docs.rollbar.com/docs/importing-or-requiring-rollbar)\n> \n> This is the recommendation for the majority of modern web applications as most applications use a bundler and modules have made their way through standards and are available in all modern browsers.\n\n## Quick Start\n\nCopy-paste the following code into the `` of every page you want to monitor. It should be as high as possible, before any other `\n```\n\nIf you're running Rollbar on an environment besides production, change the `environment` value to something else (e.g. `staging`). See more configuration options [here](https://docs.rollbar.com/docs/rollbarjs-configuration-reference).\n\n### Test your installation\n\n1. Navigate your browser to a page that has the above code installed\n2. Type the following code into the console and press enter: `window.onerror(\"TestRollbarError: testing window.onerror\", window.location.href)`\n\nIf you're on Firefox, `window.onerror` is not accessible from the console, so you'll need to try this in your code instead: `setTimeout(function() {notThere();}, 1000);`.\n\nThis simulates an uncaught error. It should appear in your project's dashboard within a few seconds.\n\n### [Updating your SDK](https://docs.rollbar.com/docs/javascript#upgrading-from-previous-versions)\n\n> 📘 \n> \n> For more information on rollbar.js, please see the docs [here](https://docs.rollbar.com/v1.0.0/docs/javascript).\n\n
\n\n### UMD\n\nrollbar.js is also distributed using UMD, so you can use it with browserify, requirejs, webpack, or anything else that uses AMD or CommonJS modules. See the [examples](https://github.com/rollbar/rollbar.js/tree/master/examples) for details.\n\n
","excerpt":"How to configure Rollbar.js to work in the browser | Support Level: Supported","slug":"browser-js","type":"basic","title":"Browser JS","__v":7,"updatedAt":"2024-04-30T15:46:17.128Z","pendingAlgoliaPublish":false,"previousSlug":"","slugUpdatedAt":"2020-07-24T00:17:25.789Z","deprecated":false,"icon":"","revision":13,"lastUpdatedHash":"fdfd10051d1a4d61a9dca7c9f3e6c3cbccdb838a","reusableContent":[],"isApi":false,"tutorials":[],"id":"5b3a2848b59ff40003acf831"},"hideTOC":false,"meta":{"_id":"5b3a2848b59ff40003acf831","description":"How to configure Rollbar.js to work in the browser | Support Level: Supported","hidden":false,"image":[],"keywords":"","metaTitle":"Browser JS","parent":"5a909ae10e4768001effac02","robots":"index","slug":"browser-js","title":"Browser JS","type":"docs"},"slugUrl":"/docs/browser-js","config":{"algoliaIndex":"readme_search_v2","amplitude":{"apiKey":"dc8065a65ef83d6ad23e37aaf014fc84","enabled":true},"asset_url":"https://cdn.readme.io","domain":"readme.io","domainFull":"https://dash.readme.com","encryptedLocalStorageKey":"ekfls-2025-03-27","fullstory":{"enabled":true,"orgId":"FSV9A"},"liveblocks":{"copilotId":"co_11Q0l0JJlkcBhhAYUFh8s"},"metrics":{"billingCronEnabled":"true","dashUrl":"https://m.readme.io","defaultUrl":"https://m.readme.io","exportMaxRetries":12,"wsUrl":"wss://m.readme.io"},"proxyUrl":"https://try.readme.io","readmeRecaptchaSiteKey":"6LesVBYpAAAAAESOCHOyo2kF9SZXPVb54Nwf3i2x","releaseVersion":"5.422.0","sentry":{"dsn":"https://3bbe57a973254129bcb93e47dc0cc46f@o343074.ingest.sentry.io/2052166","enabled":true},"shMigration":{"promoVideo":"","forceWaitlist":false,"migrationPreview":false},"sslBaseDomain":"readmessl.com","sslGenerationService":"ssl.readmessl.com","stripePk":"pk_live_5103PML2qXbDukVh7GDAkQoR4NSuLqy8idd5xtdm9407XdPR6o3bo663C1ruEGhXJjpnb2YCpj8EU1UvQYanuCjtr00t1DRCf2a","superHub":{"newProjectsEnabled":true},"wootric":{"accountToken":"NPS-122b75a4","enabled":true}},"context":{"labs":{},"user":{},"terms":[],"variables":{"user":{},"defaults":[]},"project":{"_id":"5a874ae082fdd5001282c796","appearance":{"nextStepsLabel":"Learn More","hideTableOfContents":false,"showVersion":false,"html_hidelinks":false,"html_footer_meta":"","html_head":"\n\n\n\n\n","html_footer":"
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

ProductsPlatformDocumentationResourcesCompany
ProductJavaScriptPHPDocs OverviewBlogAbout Us
PricingRubyPythonSetting up RollbarGuidesCareers
CustomersiOSJavaNotificationsContact Us
Platforms.NETAngularDeploy TrackingChangelog
IntegrationsReactLaravelTelemetry
NodeRailsSecurity & Compliance
DjangoMore...API


2012-25 Rollbar Inc. Privacy Policy Terms of Service

","html_body":"","html_promo":"","javascript_hub2":"","javascript":"","stylesheet_hub2":"@import url(https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i);\n\nbody,\np,\n.content-body .magic-block-textarea ul,\n.content-body .magic-block-api-header ul,\n.content-body .magic-block-textarea ol,\n.content-body .magic-block-api-header ol { \n color: #686868; \n}\n.content-body .magic-block-textarea h1 { color: #343F55; }\n\n/* top nav container */\nheader#hub-header #header-top .clearfix {\n height: 85px; \n}\nheader#hub-header #header-top #header-logo {\n margin-top: 18px; \n width: 120px !important;\n}\nheader#hub-header #header-top #header-nav-left li a {\n margin-right: 32px;\n padding: 0;\n}\nheader#hub-header #header-top #header-nav-left {\n margin-left: 32px; \n}\n\n/* top nav links */\n.theme-solid header#hub-header #header-top #header-nav-left li a, .theme-solid header#hub-header #header-top #header-nav-right li a {\n color: #fff;\n opacity: 1;\n font-weight: 400;\n}\n\n/* #hub-reference .hub-api .api-manager .param-table .param-item .param-item-info .param-item-table .param-item-input input[type=\"text\"] { \n border: 1px solid #2283c9; \n} */\n.param-item-input input { \n border: 1px solid #2283c9 !important; \n}\n#hub-search .searchbox{\n width:33%;\n}\ninput.search-box{\n background-color:#f0f2f4 !important;\n}\n#header-nav-left, #header-nav-right li a {\t\n font-color:#ffffff;\n font-size:16px /*!important*/;\n}\nbody{\n font-family: Roboto,\"Helvetica Neue\",Arial,sans-serif !important;\n -webkit-font-smoothing: antialiased;\n}\n\n/* side nav links */\nnav#hub-sidebar ul a {\n color: #3C72FF; \n}\n\n/* table of contents links */\nsection#hub-content #content-container section.content-toc a {\n\tcolor: #999999; !important \n}","stylesheet":"","favicon":["https://files.readme.io/5c3e804-small-Safety-500x500.png","Safety-500x500.png",32,32,"#3c72ff","https://files.readme.io/c7c7c53-Safety-500x500.png"],"logo_white_use":false,"logo_white":[],"logo":["https://files.readme.io/3a1735d-Rollbar-Logo-Reverse-Safety-White_1.svg","Rollbar-Logo-Reverse-Safety-White (1).svg",300,65,"#000000"],"promos":[{"extras":{"type":"html","buttonPrimary":"docs","buttonSecondary":"reference"},"title":"Welcome to Rollbar","text":"Check out our guides and API reference documentation on how to use Rollbar to monitor, root cause, and triage and fix issues.","_id":"5a874ae082fdd5001282c797"}],"body":{"style":"none"},"header":{"img_pos":"tl","img_size":"auto","img":[],"style":"solid","linkStyle":"buttons"},"typography":{"tk_body":"","tk_headline":"","tk_key":"","typekit":false,"body":"Open+Sans:400:sans-serif","headline":"Open+Sans:400:sans-serif"},"colors":{"body_highlight":"#3c72ff","header_text":"","main_alt":"#127DD5","main":"#343f55","highlight":"","custom_login_link_color":""},"main_body":{"type":"links"},"categoriesAsDropdown":false,"hide_logo":true,"sticky":false,"landing":true,"overlay":"triangles","notheme":false,"theme":"solid","link_logo_to_url":true,"global_landing_page":{"html":"","redirect":""},"referenceLayout":"column","childrenAsPills":false,"splitReferenceDocs":false,"rdmd":{"callouts":{"useIconFont":false},"theme":{"background":"","border":"","markdownEdge":"","markdownFont":"","markdownFontSize":"","markdownLineHeight":"","markdownRadius":"","markdownText":"","markdownTitle":"","markdownTitleFont":"","mdCodeBackground":"","mdCodeFont":"","mdCodeRadius":"","mdCodeTabs":"","mdCodeText":"","tableEdges":"","tableHead":"","tableHeadText":"","tableRow":"","tableStripe":"","tableText":"","text":"","title":""}},"subheaderStyle":"dropdown","showMetricsInReference":true,"referenceSimpleMode":true,"stylesheet_hub3":"","loginLogo":[],"logo_large":false,"colorScheme":"light","changelog":{"layoutExpanded":false,"showAuthor":true,"showExactDate":false},"allowApiExplorerJsonEditor":false,"ai_dropdown":"disabled","ai_options":{"chatgpt":"enabled","claude":"enabled","clipboard":"enabled","view_as_markdown":"enabled","copilot":"enabled","perplexity":"enabled"},"showPageIcons":true,"layout":{"full_width":false,"style":"classic"}},"custom_domain":"docs.rollbar.com","childrenProjects":[],"derivedPlan":"business","description":"","isExternalSnippetActive":false,"error404":"","experiments":[],"first_page":"docs","flags":{"directGoogleToStableVersion":false,"disableAnonForum":false,"newApiExplorer":true,"stripe":false,"hideGoogleAnalytics":false,"jwt":false,"cookieAuthentication":false,"allowXFrame":false,"speedyRender":false,"correctnewlines":false,"swagger":false,"oauth":false,"migrationSwaggerRun":false,"migrationRun":false,"hub2":true,"enterprise":false,"allow_hub2":false,"translation":false,"alwaysShowDocPublishStatus":false,"newEditor":true,"newMarkdown":false,"newMarkdownBetaProgram":false,"oldMarkdown":false,"newSearch":true,"rdmdCompatibilityMode":false,"staging":false,"tutorials":true,"allowApiExplorerJsonEditor":false,"useReactApp":true,"newHeader":false,"referenceRedesign":false,"auth0Oauth":false,"graphql":false,"singleProjectEnterprise":false,"dashReact":false,"allowReferenceUpgrade":true,"metricsV2":true,"newEditorDash":true,"enableRealtimeExperiences":false,"reviewWorkflow":true,"star":false,"allowDarkMode":false,"forceDarkMode":false,"useReactGLP":false,"disablePasswordlessLogin":false,"personalizedDocs":false,"myDevelopers":false,"superHub":false,"developerDashboard":false,"allowReusableOTPs":false,"dashHomeRefresh":false,"owlbotAi":false,"apiV2":false,"git":{"read":false,"write":false},"superHubBeta":false,"dashQuickstart":false,"disableAutoTranslate":false,"customBlocks":false,"devDashHub":false,"disableSAMLScoping":false,"allowUnsafeCustomHtmlSuggestionsFromNonAdmins":false,"apiAccessRevoked":false,"passwordlessLogin":"default","disableSignups":false,"billingRedesignEnabled":true,"developerPortal":false,"mdx":false,"superHubDevelopment":false,"annualBillingEnabled":true,"devDashBillingRedesignEnabled":false,"enableOidc":false,"customComponents":false,"disableDiscussionSpamRecaptchaBypass":false,"developerViewUsersData":false,"changelogRssAlwaysPublic":false,"bidiSync":false,"superHubMigrationSelfServeFlow":true,"apiDesigner":false,"hideEnforceSSO":false,"localLLM":false,"superHubManageVersions":false,"gitSidebar":false,"superHubGlobalCustomBlocks":false,"childManagedBidi":false,"superHubBranches":false,"externalSdkSnippets":false,"requiresJQuery":false,"migrationPreview":false,"superHubBranchReviews":false,"superHubMergePermissions":false,"superHubPreview":false},"fullBaseUrl":"https://docs.rollbar.com/","git":{"migration":{"createRepository":{},"transformation":{},"migratingPages":{},"enableSuperhub":{}},"sync":{"linked_repository":{},"installationRequest":{},"connections":[],"providers":[]}},"glossaryTerms":[],"graphqlSchema":"","gracePeriod":{"enabled":false,"endsAt":null},"shouldGateDash":false,"healthCheck":{"provider":"statusPage","settings":{"page":"0hsb4m2rq2h3","status":false,"url":""}},"intercom_secure_emailonly":false,"intercom":"","is_active":true,"integrations":{"login":{}},"internal":"","jwtExpirationTime":0,"landing_bottom":[{"type":"html","alignment":"left","html":"
\n\n
\n \n
\n Guides & SDKs\n
\n \n
\n API Reference\n
\n
"}],"mdxMigrationStatus":"rdmd","metrics":{"enabled":false,"thumbsEnabled":true,"monthlyLimit":0,"planLimit":1000000,"realtime":{"dashEnabled":false,"hubEnabled":false},"monthlyPurchaseLimit":0,"meteredBilling":{}},"modules":{"suggested_edits":true,"discuss":false,"reference":true,"examples":true,"docs":true,"landing":false,"logs":false,"changelog":false,"custompages":false,"tutorials":false,"graphql":false},"name":"Rollbar Docs","nav_names":{"discuss":"","reference":"API Reference","docs":"Guides & SDKs","changelog":"","tutorials":"","recipes":""},"oauth_url":"","onboardingCompleted":{"documentation":true,"appearance":true,"jwt":true,"api":true,"logs":false,"domain":true,"metricsSDK":false},"owlbot":{"enabled":false,"isPaying":false,"lastIndexed":"2023-07-10T19:37:50.876Z","customization":{"answerLength":"long","customTone":"","defaultAnswer":"","forbiddenWords":"","tone":"neutral"},"copilot":{"enabled":false,"hasBeenUsed":false,"installedCustomPage":""}},"owner":{"id":null,"email":null,"name":null},"plan":"business","planOverride":"","planSchedule":{"stripeScheduleId":null,"changeDate":null,"nextPlan":null},"planStatus":"active","planTrial":"business","readmeScore":{"components":{"newDesign":{"enabled":true,"points":25},"reference":{"enabled":true,"points":50},"tryItNow":{"enabled":true,"points":35},"syncingOAS":{"enabled":false,"points":10},"customLogin":{"enabled":true,"points":25},"metrics":{"enabled":false,"points":40},"recipes":{"enabled":false,"points":15},"pageVoting":{"enabled":true,"points":1},"suggestedEdits":{"enabled":true,"points":10},"support":{"enabled":true,"points":5},"htmlLanding":{"enabled":true,"points":5},"guides":{"enabled":true,"points":10},"changelog":{"enabled":false,"points":5},"glossary":{"enabled":false,"points":1},"variables":{"enabled":false,"points":1},"integrations":{"enabled":true,"points":2}},"percentScore":50,"totalScore":168},"reCaptchaSiteKey":"","reference":{"alwaysUseDefaults":true,"defaultExpandResponseExample":false,"defaultExpandResponseSchema":false,"enableOAuthFlows":false},"seo":{"overwrite_title_tag":false},"stable":{"_id":"5a876b07d24de400828cb2fd","project":"5a874ae082fdd5001282c796","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","categories":["5a876b07d24de400828cb2fe","5a876b08d24de400828cb2ff","5a876bcc82fdd5001282cb7c","5a876dd482fdd5001282cbc9","5a876e38ca7829001221eed7","5a876eec82fdd5001282cbcb","5a8f662968264c001f20c132","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","5a8f669228fe2b00125ffcff","5a8f66b628fe2b00125ffd00","5a8f66bd6b00510012de6359","5a8f66d025969d0012bc6066","5a8f693228fe2b00125ffd9c","5a90738f86916d001246342a","5a9073fb86916d00124634cc","5a90743a0a654e0033505444","5a9074400a654e0033505447","5a90825f86916d0012464674","5a9087cb0e4768001effa968","5a90882c3f89a0007db28867","5a9088a786916d00124647d0","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","5a90a2d986916d0012464cc1","5a90ae27da282100121ced2c","5a96083af8f5d70012898e10","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","5aa6fed212c154001231834e","5aeb60063566c8000349b694","5aecbfbfa4c4a200035958bd","5e04c66822bb70006bea3964","5e04ec186c2c3d005d59a743","5e14f0a9f303bb0018c74ac4","6192be6557fe57000f5aaba8","62dca6181f36f8002e0baccb","62de9e06fd51710021a7e872","62de9e1b6316c304034d006b","62dea06d88d21700a1234a48","6376b422081e400003bac42f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0","__v":35},"subdomain":"rollbar","subpath":"","superHubWaitlist":false,"topnav":{"edited":true,"right":[{"type":"url","text":"Log In","url":"https://rollbar.com/login"},{"url":"https://rollbar.com/signup?ref=docs","text":"Sign Up","type":"url"}],"left":[{"type":"docs","text":"Guides & SDKs"},{"type":"url","text":"API Reference","url":"https://docs.rollbar.com/reference"}],"bottom":[]},"trial":{"trialEndsAt":"2018-03-02T21:19:28.413Z","trialDeadlineEnabled":true},"translate":{"languages":[],"provider":"transifex","key_public":"","org_name":"","project_name":"","show_widget":false},"url":"https://rollbar.com","versions":[{"_id":"5a876b07d24de400828cb2fd","project":"5a874ae082fdd5001282c796","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","categories":["5a876b07d24de400828cb2fe","5a876b08d24de400828cb2ff","5a876bcc82fdd5001282cb7c","5a876dd482fdd5001282cbc9","5a876e38ca7829001221eed7","5a876eec82fdd5001282cbcb","5a8f662968264c001f20c132","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","5a8f669228fe2b00125ffcff","5a8f66b628fe2b00125ffd00","5a8f66bd6b00510012de6359","5a8f66d025969d0012bc6066","5a8f693228fe2b00125ffd9c","5a90738f86916d001246342a","5a9073fb86916d00124634cc","5a90743a0a654e0033505444","5a9074400a654e0033505447","5a90825f86916d0012464674","5a9087cb0e4768001effa968","5a90882c3f89a0007db28867","5a9088a786916d00124647d0","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","5a90a2d986916d0012464cc1","5a90ae27da282100121ced2c","5a96083af8f5d70012898e10","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","5aa6fed212c154001231834e","5aeb60063566c8000349b694","5aecbfbfa4c4a200035958bd","5e04c66822bb70006bea3964","5e04ec186c2c3d005d59a743","5e14f0a9f303bb0018c74ac4","6192be6557fe57000f5aaba8","62dca6181f36f8002e0baccb","62de9e06fd51710021a7e872","62de9e1b6316c304034d006b","62dea06d88d21700a1234a48","6376b422081e400003bac42f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0","__v":35},{"_id":"5ae8b59ed4b107000388de7b","project":"5a874ae082fdd5001282c796","__v":0,"forked_from":"5a876b07d24de400828cb2fd","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","categories":["5a876b07d24de400828cb2fe","5ae8b59ed4b107000388ddb8","5a876bcc82fdd5001282cb7c","5ae8b59ed4b107000388ddb9","5ae8b59ed4b107000388ddba","5a876eec82fdd5001282cbcb","5ae8b59ed4b107000388ddbb","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","5ae8b59ed4b107000388ddbc","5ae8b59ed4b107000388ddbd","5ae8b59ed4b107000388ddbe","5a8f66d025969d0012bc6066","5ae8b59ed4b107000388ddbf","5a90738f86916d001246342a","5ae8b59ed4b107000388ddc0","5a90743a0a654e0033505444","5ae8b59ed4b107000388ddc1","5ae8b59ed4b107000388ddc2","5ae8b59ed4b107000388ddc3","5ae8b59ed4b107000388ddc4","5ae8b59ed4b107000388ddc5","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","5ae8b59ed4b107000388ddc6","5a90ae27da282100121ced2c","5ae8b59ed4b107000388ddc7","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","5ae8b59ed4b107000388ddc8","6376b422081e400003bac434"],"is_deprecated":false,"is_hidden":true,"is_beta":false,"is_stable":false,"codename":"1.0.1","version_clean":"1.0.1","version":"1.0.1"},{"_id":"5dd31fffad2831001bf65d7d","project":"5a874ae082fdd5001282c796","__v":1,"forked_from":"5a876b07d24de400828cb2fd","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","categories":["5a876b07d24de400828cb2fe","5dd31fffad2831001bf65c5c","5a876bcc82fdd5001282cb7c","5dd31fffad2831001bf65c5d","5dd31fffad2831001bf65c5e","5a876eec82fdd5001282cbcb","5dd31fffad2831001bf65c5f","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","5dd31fffad2831001bf65c60","5dd31fffad2831001bf65c61","5dd31fffad2831001bf65c62","5a8f66d025969d0012bc6066","5dd31fffad2831001bf65c63","5a90738f86916d001246342a","5dd31fffad2831001bf65c64","5a90743a0a654e0033505444","5dd31fffad2831001bf65c65","5dd31fffad2831001bf65c66","5dd31fffad2831001bf65c67","5dd31fffad2831001bf65c68","5dd31fffad2831001bf65c69","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","5dd31fffad2831001bf65c6a","5a90ae27da282100121ced2c","5dd31fffad2831001bf65c6b","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","5dd31fffad2831001bf65c6c","5dd31fffad2831001bf65c6d","5dd31fffad2831001bf65c6e","5dd3219f31b0070066f715a8","6376b422081e400003bac431"],"is_deprecated":false,"is_hidden":true,"is_beta":true,"is_stable":false,"codename":"","version_clean":"1.0.2-beta-jon","version":"1.0.2-beta-jon"},{"_id":"5e47207c0e4d10001fe5a8f0","project":"5a874ae082fdd5001282c796","createdAt":"2020-02-14T22:34:36.952Z","releaseDate":"2020-02-14T22:34:36.952Z","categories":["5e47207c0e4d10001fe5a8f1","5e47207c0e4d10001fe5a8f2","5e47207c0e4d10001fe5a8f3","5e47207d0e4d10001fe5a8f4","5e47207d0e4d10001fe5a8f5","5e47207d0e4d10001fe5a8f6","5e47207d0e4d10001fe5a8f7","5e47207d0e4d10001fe5a8f8","5e47207d0e4d10001fe5a8f9","5e47207d0e4d10001fe5a8fa","5e47207d0e4d10001fe5a8fb","5e47207d0e4d10001fe5a8fc","5e47207d0e4d10001fe5a8fd","5e47207d0e4d10001fe5a8fe","5e47207d0e4d10001fe5a8ff","5e47207d0e4d10001fe5a900","5e47207d0e4d10001fe5a901","5e47207d0e4d10001fe5a902","5e47207d0e4d10001fe5a903","5e47207d0e4d10001fe5a904","6376b422081e400003bac437"],"is_deprecated":false,"is_hidden":true,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.1.0","version":"1.1.0","__v":0},{"_id":"5e47207d0e4d10001fe5a905","project":"5a874ae082fdd5001282c796","createdAt":"2020-02-14T22:34:37.025Z","releaseDate":"2020-02-14T22:34:37.025Z","categories":["5e47207d0e4d10001fe5a906","5e47207d0e4d10001fe5a907","5e47207d0e4d10001fe5a908","5e47207d0e4d10001fe5a909","5e47207d0e4d10001fe5a90a","5e47207d0e4d10001fe5a90b","5e47207d0e4d10001fe5a90c","5e47207d0e4d10001fe5a90d","5e47207d0e4d10001fe5a90e","5e47207d0e4d10001fe5a90f","5e47207d0e4d10001fe5a910","5e47207d0e4d10001fe5a911","5e47207d0e4d10001fe5a912","5e47207d0e4d10001fe5a913","5e47207d0e4d10001fe5a914","5e47207d0e4d10001fe5a915","5e47207d0e4d10001fe5a916","6376b422081e400003bac432"],"is_deprecated":false,"is_hidden":true,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.2.0","version":"1.2.0","__v":0},{"_id":"5e47207d0e4d10001fe5a917","project":"5a874ae082fdd5001282c796","createdAt":"2020-02-14T22:34:37.064Z","releaseDate":"2020-02-14T22:34:37.064Z","categories":["5e47207d0e4d10001fe5a918","5e47207d0e4d10001fe5a919","5e47207d0e4d10001fe5a91a","5e47207d0e4d10001fe5a91b","5e47207d0e4d10001fe5a91c","5e47207d0e4d10001fe5a91d","5e47207d0e4d10001fe5a91e","5e47207d0e4d10001fe5a91f","5e47207d0e4d10001fe5a920","5e47207d0e4d10001fe5a921","5e47207d0e4d10001fe5a922","5e47207d0e4d10001fe5a923","5e47207d0e4d10001fe5a924","5e47207d0e4d10001fe5a925","5e47207d0e4d10001fe5a926","5e47207d0e4d10001fe5a927","5e47207d0e4d10001fe5a928","5e47207d0e4d10001fe5a929","5e47207d0e4d10001fe5a92a","5e47207d0e4d10001fe5a92b","6376b422081e400003bac430"],"is_deprecated":false,"is_hidden":true,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.3.0","version":"1.3.0","__v":0},{"_id":"62014cb96b66a300303998b6","version":"1.4.0","version_clean":"1.4.0","codename":"Feb 22","is_stable":false,"is_beta":false,"is_hidden":true,"is_deprecated":false,"categories":["5a876b07d24de400828cb2fe","62014cb86b66a30030399739","5a876bcc82fdd5001282cb7c","62014cb86b66a3003039973a","62014cb86b66a3003039973b","5a876eec82fdd5001282cbcb","62014cb86b66a3003039973c","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","62014cb86b66a3003039973d","62014cb86b66a3003039973e","62014cb86b66a3003039973f","5a8f66d025969d0012bc6066","62014cb86b66a30030399740","5a90738f86916d001246342a","62014cb86b66a30030399741","5a90743a0a654e0033505444","62014cb86b66a30030399742","62014cb86b66a30030399743","62014cb86b66a30030399744","62014cb86b66a30030399745","62014cb86b66a30030399746","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","62014cb86b66a30030399747","5a90ae27da282100121ced2c","62014cb86b66a30030399748","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","62014cb86b66a30030399749","62014cb86b66a3003039974a","62014cb86b66a3003039974b","5e04c66822bb70006bea3964","5e04ec186c2c3d005d59a743","62014cb86b66a3003039974c","62014cb86b66a3003039974d","6376b422081e400003bac435"],"project":"5a874ae082fdd5001282c796","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","__v":1,"forked_from":"5a876b07d24de400828cb2fd"}],"variableDefaults":[],"webhookEnabled":false,"isHubEditable":true},"projectStore":{"data":{"allow_crawlers":"disabled","canonical_url":null,"default_version":{"name":"1.0.0"},"description":null,"glossary":[],"homepage_url":"https://rollbar.com","id":"5a874ae082fdd5001282c796","name":"Rollbar Docs","parent":null,"redirects":[],"sitemap":"disabled","llms_txt":"disabled","subdomain":"rollbar","suggested_edits":"enabled","uri":"/projects/me","variable_defaults":[],"webhooks":[],"api_designer":{"allow_editing":"enabled"},"custom_login":{"login_url":null,"logout_url":null},"features":{"mdx":"disabled"},"mcp":{},"onboarding_completed":{"api":true,"appearance":true,"documentation":true,"domain":true,"jwt":true,"logs":false,"metricsSDK":false},"pages":{"not_found":null},"privacy":{"openapi":"admin","password":null,"view":"public"},"refactored":{"status":"disabled","migrated":"unknown"},"seo":{"overwrite_title_tag":"disabled"},"plan":{"type":"business","grace_period":{"enabled":false,"end_date":null},"trial":{"expired":false,"end_date":"2018-03-02T21:19:28.413Z"}},"reference":{"api_sdk_snippets":"enabled","defaults":"always_use","json_editor":"disabled","oauth_flows":"disabled","request_history":"enabled","response_examples":"collapsed","response_schemas":"collapsed","sdk_snippets":{"external":"disabled"}},"health_check":{"provider":"statuspage","settings":{"manual":{"status":"down","url":null},"statuspage":{"id":"0hsb4m2rq2h3"}}},"integrations":{"aws":{"readme_webhook_login":{"region":null,"external_id":null,"role_arn":null,"usage_plan_id":null}},"bing":{"verify":null},"google":{"analytics":null,"site_verification":null},"heap":{"id":null},"koala":{"key":null},"localize":{"key":null},"postman":{"key":null,"client_id":null,"client_secret":null},"recaptcha":{"site_key":null,"secret_key":null},"segment":{"key":null,"domain":null},"speakeasy":{"key":null,"spec_url":null},"stainless":{"key":null,"name":null},"typekit":{"key":null},"zendesk":{"subdomain":null},"intercom":{"app_id":null,"secure_mode":{"key":null,"email_only":false}}},"permissions":{"appearance":{"private_label":"enabled","custom_code":{"css":"enabled","html":"enabled","js":"enabled"}},"branches":{"merge":{"admin":true}}},"appearance":{"brand":{"primary_color":"#343f55","link_color":"#3c72ff","theme":"light"},"changelog":{"layout":"collapsed","show_author":true,"show_exact_date":false},"layout":{"full_width":"disabled","style":"classic"},"markdown":{"callouts":{"icon_font":"emojis"}},"table_of_contents":"enabled","whats_next_label":"Learn More","footer":{"readme_logo":"hide"},"logo":{"size":"default","dark_mode":{"uri":null,"url":null,"name":null,"width":null,"height":null,"color":null,"links":{"original_url":null}},"main":{"uri":null,"url":"https://files.readme.io/3a1735d-Rollbar-Logo-Reverse-Safety-White_1.svg","name":"Rollbar-Logo-Reverse-Safety-White (1).svg","width":300,"height":65,"color":"#000000","links":{"original_url":null}},"favicon":{"uri":null,"url":"https://files.readme.io/5c3e804-small-Safety-500x500.png","name":"Safety-500x500.png","width":32,"height":32,"color":"#3c72ff","links":{"original_url":"https://files.readme.io/c7c7c53-Safety-500x500.png"}}},"custom_code":{"css":"@import url(https://fonts.googleapis.com/css?family=Roboto:400,400i,700,700i);\n\nbody,\np,\n.content-body .magic-block-textarea ul,\n.content-body .magic-block-api-header ul,\n.content-body .magic-block-textarea ol,\n.content-body .magic-block-api-header ol { \n color: #686868; \n}\n.content-body .magic-block-textarea h1 { color: #343F55; }\n\n/* top nav container */\nheader#hub-header #header-top .clearfix {\n height: 85px; \n}\nheader#hub-header #header-top #header-logo {\n margin-top: 18px; \n width: 120px !important;\n}\nheader#hub-header #header-top #header-nav-left li a {\n margin-right: 32px;\n padding: 0;\n}\nheader#hub-header #header-top #header-nav-left {\n margin-left: 32px; \n}\n\n/* top nav links */\n.theme-solid header#hub-header #header-top #header-nav-left li a, .theme-solid header#hub-header #header-top #header-nav-right li a {\n color: #fff;\n opacity: 1;\n font-weight: 400;\n}\n\n/* #hub-reference .hub-api .api-manager .param-table .param-item .param-item-info .param-item-table .param-item-input input[type=\"text\"] { \n border: 1px solid #2283c9; \n} */\n.param-item-input input { \n border: 1px solid #2283c9 !important; \n}\n#hub-search .searchbox{\n width:33%;\n}\ninput.search-box{\n background-color:#f0f2f4 !important;\n}\n#header-nav-left, #header-nav-right li a {\t\n font-color:#ffffff;\n font-size:16px /*!important*/;\n}\nbody{\n font-family: Roboto,\"Helvetica Neue\",Arial,sans-serif !important;\n -webkit-font-smoothing: antialiased;\n}\n\n/* side nav links */\nnav#hub-sidebar ul a {\n color: #3C72FF; \n}\n\n/* table of contents links */\nsection#hub-content #content-container section.content-toc a {\n\tcolor: #999999; !important \n}","js":null,"html":{"header":"\n\n\n\n\n","home_footer":"
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

ProductsPlatformDocumentationResourcesCompany
ProductJavaScriptPHPDocs OverviewBlogAbout Us
PricingRubyPythonSetting up RollbarGuidesCareers
CustomersiOSJavaNotificationsContact Us
Platforms.NETAngularDeploy TrackingChangelog
IntegrationsReactLaravelTelemetry
NodeRailsSecurity & Compliance
DjangoMore...API


2012-25 Rollbar Inc. Privacy Policy Terms of Service

","page_footer":null}},"header":{"type":"solid","gradient_color":"#127DD5","link_style":"buttons","overlay":{"fill":"auto","type":"triangles","position":"top-left","image":{"uri":null,"url":null,"name":null,"width":null,"height":null,"color":null,"links":{"original_url":null}}}},"ai":{"dropdown":"disabled","options":{"chatgpt":"enabled","claude":"enabled","clipboard":"enabled","copilot":"enabled","view_as_markdown":"enabled"}},"navigation":{"first_page":"documentation","left":[{"type":"guides","title":null,"url":null,"custom_page":null},{"type":"link_url","title":"API Reference","url":"https://docs.rollbar.com/reference","custom_page":null}],"logo_link":"homepage","page_icons":"enabled","right":[{"type":"link_url","title":"Log In","url":"https://rollbar.com/login","custom_page":null},{"type":"link_url","title":"Sign Up","url":"https://rollbar.com/signup?ref=docs","custom_page":null}],"sub_nav":[],"subheader_layout":"dropdown","version":"disabled","links":{"home":{"label":"Home","visibility":"disabled"},"graphql":{"label":"GraphQL","visibility":"disabled"},"guides":{"label":"Guides","alias":"Guides & SDKs","visibility":"enabled"},"reference":{"label":"API Reference","alias":"API Reference","visibility":"enabled"},"recipes":{"label":"Recipes","alias":null,"visibility":"disabled"},"changelog":{"label":"Changelog","alias":null,"visibility":"disabled"},"discussions":{"label":"Discussions","alias":null,"visibility":"disabled"}}}},"git":{"connection":{"repository":{},"organization":null,"status":"inactive"}}}},"version":{"_id":"5a876b07d24de400828cb2fd","project":"5a874ae082fdd5001282c796","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","categories":["5a876b07d24de400828cb2fe","5a876b08d24de400828cb2ff","5a876bcc82fdd5001282cb7c","5a876dd482fdd5001282cbc9","5a876e38ca7829001221eed7","5a876eec82fdd5001282cbcb","5a8f662968264c001f20c132","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","5a8f669228fe2b00125ffcff","5a8f66b628fe2b00125ffd00","5a8f66bd6b00510012de6359","5a8f66d025969d0012bc6066","5a8f693228fe2b00125ffd9c","5a90738f86916d001246342a","5a9073fb86916d00124634cc","5a90743a0a654e0033505444","5a9074400a654e0033505447","5a90825f86916d0012464674","5a9087cb0e4768001effa968","5a90882c3f89a0007db28867","5a9088a786916d00124647d0","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","5a90a2d986916d0012464cc1","5a90ae27da282100121ced2c","5a96083af8f5d70012898e10","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","5aa6fed212c154001231834e","5aeb60063566c8000349b694","5aecbfbfa4c4a200035958bd","5e04c66822bb70006bea3964","5e04ec186c2c3d005d59a743","5e14f0a9f303bb0018c74ac4","6192be6557fe57000f5aaba8","62dca6181f36f8002e0baccb","62de9e06fd51710021a7e872","62de9e1b6316c304034d006b","62dea06d88d21700a1234a48","6376b422081e400003bac42f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0","__v":35}},"is404":false,"isDetachedProductionSite":false,"lang":"en","langFull":"Default","reqUrl":"/docs/browser-js","version":{"_id":"5a876b07d24de400828cb2fd","project":"5a874ae082fdd5001282c796","createdAt":"2018-02-16T23:36:39.997Z","releaseDate":"2018-02-16T23:36:39.997Z","categories":["5a876b07d24de400828cb2fe","5a876b08d24de400828cb2ff","5a876bcc82fdd5001282cb7c","5a876dd482fdd5001282cbc9","5a876e38ca7829001221eed7","5a876eec82fdd5001282cbcb","5a8f662968264c001f20c132","5a8f66326b00510012de6354","5a8f665f6b00510012de6356","5a8f668168264c001f20c135","5a8f669228fe2b00125ffcff","5a8f66b628fe2b00125ffd00","5a8f66bd6b00510012de6359","5a8f66d025969d0012bc6066","5a8f693228fe2b00125ffd9c","5a90738f86916d001246342a","5a9073fb86916d00124634cc","5a90743a0a654e0033505444","5a9074400a654e0033505447","5a90825f86916d0012464674","5a9087cb0e4768001effa968","5a90882c3f89a0007db28867","5a9088a786916d00124647d0","5a908b8e0e4768001effaa4c","5a908dde0e4768001effaa7a","5a909eb2670276004812dbdf","5a90a2d986916d0012464cc1","5a90ae27da282100121ced2c","5a96083af8f5d70012898e10","5a981af6b2db650012329915","5a981c2af5fcaa0012144047","5aa6fed212c154001231834e","5aeb60063566c8000349b694","5aecbfbfa4c4a200035958bd","5e04c66822bb70006bea3964","5e04ec186c2c3d005d59a743","5e14f0a9f303bb0018c74ac4","6192be6557fe57000f5aaba8","62dca6181f36f8002e0baccb","62de9e06fd51710021a7e872","62de9e1b6316c304034d006b","62dea06d88d21700a1234a48","6376b422081e400003bac42f"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0.0","__v":35}}">