Skip to content

Getting started

In this tutorial you add telltale to an app with a FastAPI backend and a React frontend. By the end you will have caused an error, sent a feedback note, and read both in the console.

You need a checkout of the telltale repo, Python 3.11 or newer, and the app. SQLite needs no database server, so this tutorial uses it.

From the telltale checkout, copy the Python package into your app:

Terminal window
scripts/vendor.sh python path/to/myapp/vendor

This makes path/to/myapp/vendor/telltale/. Add telltale’s dependencies to your app’s environment:

Terminal window
uv pip install "sqlalchemy>=2" "fastapi>=0.100" "pydantic>=2"

In the file where you build your FastAPI app, add telltale after your routers:

from fastapi import FastAPI
from .vendor.telltale import Config, Telltale
app = FastAPI()
# ... your routers ...
tt = Telltale(Config.from_env(app="myapp", api_prefix="/api"))
tt.install(app)

Set api_prefix to the path your own API lives under. If the app also serves a frontend at /, put these lines before that mount.

Terminal window
export TELLTALE_DB_URL=sqlite:////tmp/telltale-try.db
export TELLTALE_ADMIN_KEY=try-it-out-admin-key

Start the app. telltale makes its tables on the first start, so /tmp/telltale-try.db now exists.

Request a path your app does not have:

Terminal window
curl -s http://localhost:8000/api/no-such-thing

You get your app’s usual 404, and telltale records it.

Terminal window
curl -s -X POST http://localhost:8000/api/feedback \
-H 'Content-Type: application/json' \
-d '{"text": "Trying out telltale", "category": "other"}'

The answer has status 201, the new note’s id, and a thank-you message.

Open http://localhost:8000/api/_telltale/admin/ and enter try-it-out-admin-key. The inbox lists two items: a group titled request_error http_404 GET <unmatched>, and your note. telltale writes to the database every few seconds, so reload if they are not there yet.

Next, let the page report its own errors and show a feedback button. From the telltale checkout:

Terminal window
scripts/vendor.sh js path/to/frontend/src/vendor/telltale

In main.tsx, start telltale before you render the app:

import { init, wrapFetch } from './vendor/telltale/telltale-web.js'
init({ app: 'myapp', endpoint: '/api' })
window.fetch = wrapFetch(window.fetch)

Add the feedback button to your layout:

import { FeedbackButton } from './vendor/telltale/react/FeedbackButton.jsx'
<FeedbackButton />

Reload the page. A “Send feedback” button appears in the bottom right corner. Send a note with it, and the note shows up in the console under the first one.