Skip to content

Browser package

Copy it in with scripts/vendor.sh js <dest>. The functions are in telltale-web.js; the React components are in react/.

Starts error reporting. Call once, before the app renders; later calls do nothing.

OptionDefaultMeaning
appnoneThe app name records are filed under.
endpoint''The app’s API prefix, such as /api. Reports go to {endpoint}/_telltale/client and feedback to {endpoint}/feedback.
release'dev'Release label sent with each report.
flushMs2000How often queued reports are sent.
maxBatch20Most reports per request.
scrubExtra[]Extra regexes to scrub from report text.
listenerstrueListen for uncaught errors and unhandled promise rejections.
reportHttpErrorsfalseAlso report failed API responses. Leave off when the API has telltale, which records them itself.

configure({ reportHttpErrors, authFetch })

Section titled “configure({ reportHttpErrors, authFetch })”

Changes options after init. authFetch is your app’s own authenticated fetch; sendFeedback uses it so the server knows who is signed in. Error reports never use it.

Returns a fetch that adds the X-Telltale-Client and X-Telltale-Session headers to API calls and reports network failures. Use as window.fetch = wrapFetch(window.fetch). With axios, call axiosInterceptor(axios) instead.

Sets the current route pattern, such as /projects/:id. Call it on each route change. Pass the pattern, never the real URL.

Reports one event yourself, such as a crash your error page caught.

sendFeedback({ text, category, contact, page, entity_type, entity_id })

Section titled “sendFeedback({ text, category, contact, page, entity_type, entity_id })”

Sends a feedback note. Returns a promise.

flush() sends queued reports now. shutdown() stops reporting. scrub(text) returns text with private details replaced. errDetail(err) makes a short, scrubbed description of an error. getSession() returns the session id.

import { FeedbackButton } from './vendor/telltale/react/FeedbackButton.jsx'
PropDefaultMeaning
label'Send feedback'Button text.
placement'bottom-right'bottom-left, top-right, top-left or inline.
categories['bug', 'idea', 'question', 'other']Categories offered.
showContacttrueShow the contact box.
signedInAsnoneShows “Sending as …” in place of the contact box. Display only.
title, sentTitle, sentTextDialog text.
sendsendFeedbackFunction that sends the note.
onSentnoneCalled with the result after a note is sent.
open, onOpenChangenoneControl the dialog yourself.
hideTriggerfalseHide the button, for a dialog opened from your own menu.
className, stylenoneStyling for the button.
import { ErrorBoundary } from './vendor/telltale/react/ErrorBoundary.jsx'

Reports a render crash, then shows fallback. fallback is a node or a function (error, reset) => node. onError(error, info) is called after the report.

import { TelltaleConsole } from './vendor/telltale/react/TelltaleConsole.jsx'
import './vendor/telltale/console/console.css'
PropDefaultMeaning
apiBaserequiredWhere the telltale API lives, such as /api/_telltale.
fetchnoneYour app’s authenticated fetch. With it, the console never asks for a key.
appfirst app listedApp to show first.
view'inbox'inbox or stats.
stage'todo'todo, reported, suggested, filed or closed.
opennone{type, id} of an item to open on load.
className, stylenoneStyling for the wrapper.

Without React, mountConsole(element, options) from console/console.js takes the same options.