# 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](https://github.com/databio/telltale), Python 3.11 or newer, and the app. SQLite needs no database server, so this tutorial uses it.

## 1. Copy the backend package

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

```bash
scripts/vendor.sh python path/to/myapp/vendor
```

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

```bash
uv pip install "sqlalchemy>=2" "fastapi>=0.100" "pydantic>=2"
```

## 2. Turn it on

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

```python
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.

## 3. Give it a database and a key

```bash
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.

## 4. Cause an error

Request a path your app does not have:

```bash
curl -s http://localhost:8000/api/no-such-thing
```

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

## 5. Send a feedback note

```bash
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

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

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

```bash
scripts/vendor.sh js path/to/frontend/src/vendor/telltale
```

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

```jsx
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:

```jsx
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.

## Next

- [Label your agents](/telltale/how-to/label-agents.md), so agent traffic is not counted as scripts.
- [Add feedback to an app with sign-in](/telltale/how-to/feedback-with-sign-in.md), so each note says who sent it.
- [Configuration](/telltale/reference/configuration.md) has every setting, including Postgres and MySQL URLs.
