Skip to content

Instantly share code, notes, and snippets.

@goldylucks
Created June 19, 2018 18:51
Show Gist options
  • Save goldylucks/b5f5cf871c7ecfb50fa20657b8bd7037 to your computer and use it in GitHub Desktop.
Save goldylucks/b5f5cf871c7ecfb50fa20657b8bd7037 to your computer and use it in GitHub Desktop.
backtrace crash reporting example
import { crashReporter } from 'electron'
import bt from 'backtrace-js'
import pjson from '../../package.json'
export default { initForMain, initForRenderer }
const token = '3951a92f3c2901f77b728dfadd9539d6120d3fa23d709ccc7980564dda045004'
const endpoint = 'https://zenprotocol.sp.backtrace.io:8443'
const attributes = {
NODE_ENV: process.env.NODE_ENV,
walletVersion: pjson.version,
zenNodeVersion: pjson.dependencies['@zen/zen-node'],
}
function initForMain() {
crashReporter.start({
productName: 'ZenProtocol',
companyName: 'zenwallet',
submitURL: `${endpoint}/post?format=minidump&token=${token}`,
uploadToServer: true,
extra: attributes,
})
}
function initForRenderer() {
bt.initialize({
endpoint,
token,
attributes,
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment