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.
1. Copy the backend package
Section titled “1. Copy the backend package”From the telltale checkout, copy the Python package into your app:
scripts/vendor.sh python path/to/myapp/vendorThis makes path/to/myapp/vendor/telltale/. Add telltale’s dependencies to your app’s environment:
uv pip install "sqlalchemy>=2" "fastapi>=0.100" "pydantic>=2"2. Turn it on
Section titled “2. Turn it on”In the file where you build your FastAPI app, add telltale after your routers:
from fastapi import FastAPIfrom .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.
3. Give it a database and a key
Section titled “3. Give it a database and a key”export TELLTALE_DB_URL=sqlite:////tmp/telltale-try.dbexport TELLTALE_ADMIN_KEY=try-it-out-admin-keyStart the app. telltale makes its tables on the first start, so /tmp/telltale-try.db now exists.
4. Cause an error
Section titled “4. Cause an error”Request a path your app does not have:
curl -s http://localhost:8000/api/no-such-thingYou get your app’s usual 404, and telltale records it.
5. Send a feedback note
Section titled “5. Send a feedback note”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.
6. Open the console
Section titled “6. Open the console”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.
7. Add the browser package
Section titled “7. Add the browser package”Next, let the page report its own errors and show a feedback button. From the telltale checkout:
scripts/vendor.sh js path/to/frontend/src/vendor/telltaleIn 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.
- Label your agents, so agent traffic is not counted as scripts.
- Add feedback to an app with sign-in, so each note says who sent it.
- Configuration has every setting, including Postgres and MySQL URLs.