JavaScript client for Peakflow error reporting with browser, Node, and Expo/React Native support.
npm install peakflow-apiJavaScript client for Peakflow error reporting with browser, Node, and Expo/React Native support.
``sh`
npm install peakflow
`js
import {BugReporting, debuggerInstance} from "peakflow"
const bugReporting = new BugReporting({authToken: "your-token"})
bugReporting.connect()
`
By default, BugReporting uses XMLHttpRequest when available, otherwise it falls back to fetch. If neither is available, you must provide a request class.
`js
import {BugReporting, NodeRequest} from "peakflow"
const bugReporting = new BugReporting({
authToken: "your-token",
RequestClass: NodeRequest
})
`
`js
import {BugReporting} from "peakflow"
const bugReporting = new BugReporting({authToken: "your-token"})
// Optional: enable source map parsing for script tags in web apps.
bugReporting.enableSourceMapsLoader()
bugReporting.connectOnError()
bugReporting.connectUnhandledRejection()
`
`js
import {BugReporting} from "peakflow"
const bugReporting = new BugReporting({authToken: "your-token"})
bugReporting.connectNodeUncaughtException()
bugReporting.connectNodeUnhandledRejection()
`
`js
import {BugReporting} from "peakflow"
const bugReporting = new BugReporting({authToken: "your-token"})
bugReporting.connectExpoErrorHandlers()
`
`sh`
npx peakflow-api login
npx peakflow-api build-logs --latest-build-group --failing
The CLI stores credentials in .peakflow-api/credentials.json` at the git root and uses the current branch by default.