Add Talaria with an agent
Agent playbook — identity first, confirm before create, bootstrap key + first event, verify ingest.
Design centre: a developer connects Talaria MCP and says “Add Talaria to this project.” You combine local project context + these docs + live Talaria tools.
Conversation script (follow in order)
1. Load this playbook and detect the stack
docs_getpathguides/add-talaria-with-an-agent(public).- Inspect the local repo with IDE tools. Map the stack:
| Signal | Likely SDK |
|---|---|
| Flutter | talaria_flutter → sdk/flutter |
| Dart | talaria → sdk/dart |
| Serverpod | talaria_serverpod → sdk/serverpod |
| Next.js | @newtalaria/nextjs → sdk/nextjs |
| React | @newtalaria/react → sdk/react |
| Node | @newtalaria/node → sdk/node |
| Browser | @newtalaria/browser → sdk/javascript |
| Laravel | talaria/laravel → sdk/laravel |
| Silverstripe | talaria/silverstripe → sdk/silverstripe |
| PHP | talaria/talaria → sdk/php |
docs_searchwithsdkfilter and queryinstall/init/bootstrap, thendocs_getthe stack README and configuration. Alsodocs_getsdk/<id>/instrumentationandsdk/<id>/errorsfor that stack (javascript,react,nextjs,node,php,laravel,silverstripe,dart,flutter,serverpod).
2. Authenticate and announce identity
- If org tools fail with Unauthorized, run MCP auth / reconnect with install scopes (
mcp:read mcp:write mcp:keys). - Call
get_connectionimmediately after auth. - Announce to the user (mandatory, before any mutate):
You’re connected as {name} (
{email}) under organization {orgName}.
This connection can {install capabilities}.
You also belong to {otherOrganizations}. Wrong org? Say which to switch to. Wrong account? Disconnect Talaria MCP and sign in as the other user.
- Wrong org →
switch_organizationwith thatorganizationId→ callget_connectionagain → re-announce. - Wrong account → stop mutating; tell them to reconnect MCP as the other Talaria user.
3. Ask before creating
- Suggest a project name from the local app (e.g. package name / folder).
- List existing projects from
get_connection.projectsorget_projects. - Ask (never auto-create):
Create a new Talaria project named {suggested} in {orgName}, wire the SDK, mint an ingest key, and send a first test event?
Or reuse an existing project?
4. Bootstrap only after yes
- On yes / reuse →
setup_projectwithconfirmed: trueand eithernameorprojectId. Prefer this over separatecreate_project+create_api_key. This mints a development key. Production shipping is a second key, created when someone is actually shipping. - Put the one-time
apiKeyonly in env /--dart-define/ ignored local config. Never committal_live_…. Do not echo the key later. The key decides the environment. Do not passenvironmentin SDK init. - Edit the app from the SDK docs (dependency, init, framework hooks). Local runs still send a version or SHA as
release. - If Node or Next.js server code talks to a database,
docs_getpathsdk/node/instrumentationand follow the snippet for that library. Wrap the object that runs the SQL, afterTalaria.init:pg→wrapPgon thePoolorClient.mysql2→wrapMysql2on the pool.redisorioredis→wrapRedis. The span uses the command name. Leave the key and the value off the span.@duckdb/node-api→wrapDuckDBon the connection frominstance.connect(). LeaveDuckDBInstanceunwrapped.- Prisma with
@prisma/adapter-pg→wrapPgthe pool, then pass it toPrismaPg. A defaultPrismaClientdoes not callquery. Without an adapter, timefindManywithTalaria.startSpanand do not copy thewhereobject onto the span. - Drizzle and Kysely → wrap the pool you pass into
drizzle()orPostgresDialect/MysqlDialect. - Knex and Sequelize open their own connections. Use the Knex query events or the Sequelize
beforeQuery/afterQueryhooks from that page. Do not wrap a separate pool and expect those queries to appear. - MongoDB,
better-sqlite3, andnode:sqlitehave no wrapper. Open a CLIENT span around the call. Leave bound values, documents, and result rows in the app.
- Call
send_test_eventon the realprojectId. - Verify with
search_events/search_errors, passingenvironment: development. A just-installed project has no production key, and these tools default to development in that case; passdevelopmentanyway so a later production key does not hide the local traffic. Install success issearch_errorsorsearch_eventson development.get_project_statscountsByEnvironmentis analytics volume and stays 0 when analytics is off. - Close with the
dashboardUrland how to run the app with the key. The dashboard shell reads one environment at a time and defaults to production when a production key exists, otherwise development. Switch to Development to see this install.
Do not claim “Talaria is wired” until step 6 returns the test event.
5. Source maps for browser, React, and Next
After init, a minified stack stays minified until maps are uploaded for the same release.
docs_getpathguides/upload-javascript-source-maps(command reference:sdk/javascript/source-maps).- Set
Talaria.init({ release: 'local' })for a local run, or the git SHA in CI. The release string on events must match the upload. - Ask before minting a second key. Call
create_api_keywithscopes: ["releases:write"]and a name likesource maps. Do not add that scope to the browser key fromsetup_project. - Put the raw key only in
TALARIA_RELEASE_KEY. Then runnpx talaria sourcemaps upload ./dist(local default ishttp://localhost:8080and releaselocal). - Open the event with
get_event. If a frame is still a hashed*.jsfile, callget_source_mapand upload thefileNameit returns.
App init vs Project settings
| In app init | In Project settings (remote getConfig) |
|---|---|
| DSN / base URL | Tracing on/off + sample rate |
| API key (this chooses the environment) | Analytics on/off |
| release (version or SHA) | Heatmaps on/off |
| minLevel, beforeSend, tags | Session replay on/off + rates |
setup_project enables tracing by default. Leave analytics / heatmaps / replay alone unless the user opts in with consent guidance.
Until remote config arrives, SDKs send errors only. Flutter does not support browser session replay.
Production loop (after install)
search_errorswithenvironment: production(the default once a production key exists) →get_error→ optionalget_trace/search_sessionsin that same environment.- Fix code locally.
- Instrument more using docs.
docs_searchwith the stacksdkfilter forinstrumentation,tracing,errors, oranalytics, thendocs_getthe top hit. Analytics and feature flags are onsdk/<id>/best-practices. - Re-verify with stats and search tools.
Do not automate blindly
- Creating billing orgs / paying plans
- Committing ingest keys
- Creating projects or minting keys without announcing identity and asking first
- Enabling replay/analytics without consent guidance
- Claiming features the stack does not support (e.g. browser session replay on Flutter)
- Switching Talaria accounts via tools (reconnect MCP instead)