Skip to content

Quick Start

Follow these steps (demo video) to integrate a bug report widget like below into your site:

  1. Generate a Public App ID in workspace's settings. Whitelist domains on which the SDK will be integrated. See here if you have questions how to configure domains.

  2. Copy-paste the snippet below into your page's <body>:

<script type="text/javascript">
;(function(){const birdeatsbug=(window.birdeatsbug=window.birdeatsbug||[]);if(birdeatsbug.initialize)return;if(birdeatsbug.invoked){if(window.console&&console.error){console.error('birdeatsbug snippet included twice.')}return}birdeatsbug.invoked=true;birdeatsbug.methods=['setOptions','startSession','resumeSession','startRecording','stopRecording','stopSession','uploadSession','deleteSession'];birdeatsbug.factory=function(method){return function(){var args=Array.prototype.slice.call(arguments);args.unshift(method);birdeatsbug.push(args);return birdeatsbug}};for(var i=0;i<birdeatsbug.methods.length;i++){var key=birdeatsbug.methods[i];birdeatsbug[key]=birdeatsbug.factory(key)}birdeatsbug.load=function(){var script=document.createElement('script');script.type='module';script.async=true;script.src='https://sdk.birdeatsbug.com/latest/core.js';var first=document.getElementsByTagName('script')[0];first.parentNode.insertBefore(script,first);const style=document.createElement('link');style.rel='stylesheet';style.type='text/css';style.href='https://sdk.birdeatsbug.com/latest/style.css';first.parentNode.insertBefore(style,first)};birdeatsbug.load();
window.birdeatsbug.setOptions({publicAppId:'yourPublicAppId'})})();
</script>
Non-minified
<script type="text/javascript">
; (function() {
	// Create a queue, but don't obliterate an existing one!
	const birdeatsbug = (window.birdeatsbug = window.birdeatsbug || [])
	// If the real SDK is already on the page, return.
	if (birdeatsbug.initialize) return
	// If the snippet was invoked already, show an error.
	if (birdeatsbug.invoked) {
		if (window.console && console.error) {
			console.error('birdeatsbug snippet included twice.')
		}
		return
	}
	// Invoked flag, to make sure the snippet is never invoked twice.
	birdeatsbug.invoked = true
	// A list of the methods in the SDK to stub.
	birdeatsbug.methods = [
		'setOptions',
		'startSession',
		'resumeSession',
		'startRecording',
		'stopRecording',
		'stopSession',
		'uploadSession',
		'deleteSession',
	]
	// Define a factory to create stubs. These are placeholders
	// for methods in the SDK so that you never have to wait
	// for it to load to record method calls. The `method` is
	// stored as the first argument, so we can replay the data.
	birdeatsbug.factory = function(method) {
		return function() {
			var args = Array.prototype.slice.call(arguments)
			args.unshift(method)
			birdeatsbug.push(args)
			return birdeatsbug
		}
	}
	// For each of our methods, generate a queueing stub.
	for (var i = 0; i < birdeatsbug.methods.length; i++) {
		var key = birdeatsbug.methods[i]
		birdeatsbug[key] = birdeatsbug.factory(key)
	}
	// Define a method to load the SDK
	// and that will be sure to only ever load it once.
	birdeatsbug.load = function() {
		// Create an async script element.
		var script = document.createElement('script')
		script.type = 'module'
		script.async = true
		script.src = 'https://sdk.birdeatsbug.com/latest/core.js'
		// Insert the script next to the first script element.
		var first = document.getElementsByTagName('script')[0]
		first.parentNode.insertBefore(script, first)

		// Create an async style element
		const style = document.createElement('link')
		style.rel = 'stylesheet'
		style.type = 'text/css'
		style.href = 'https://sdk.birdeatsbug.com/latest/style.css'
		// Insert the styles next to the first script element.
		first.parentNode.insertBefore(style, first)
	}
	// Load SDK
	birdeatsbug.load()
	// Pass options
	window.birdeatsbug.setOptions({ publicAppId: 'yourPublicAppId' })
})()
</script>
  1. Replace yourPublicAppId with the one generated in the workspace settings.

Done - now all users of the page can report bugs like a pro! 🚀