JavaScript SDK
Quick setup for @newtalaria/browser — install, init, and send the first error. Errors, tracing, replay, web vitals, analytics, and feature flags.
@newtalaria/browser (0.5.3) is the browser SDK. Install this package in a plain web app. React, Next.js, and framework adapters that inject a script use their own guides.
Quick setup
- Install the package and init once, before the rest of the app runs.
- Send one exception.
- Confirm it with MCP
search_errorsandenvironment: development, or open Issues in the dashboard.
npm install @newtalaria/browserimport { Talaria } from '@newtalaria/browser';
Talaria.init({
dsn: 'https://ingest.newtalaria.com',
apiKey: 'tal_live_…',
release: '1.0.0',
minLevel: 'warning',
});
await Talaria.captureException(new Error('talaria hello'));
await Talaria.flush();tal_live_… keys are public client ingest credentials. Put the key in the bundle through your build (an env var replaced at build time is fine). The key decides the environment. A local install uses a development key. Do not pass environment in init.
minLevel: 'warning' drops info and debug messages. captureException is an error, so this setup still shows up in Issues.
What you can do
| Capability | Where |
|---|---|
| Errors, logs, breadcrumbs, user, tags, and release | Errors, logs, and breadcrumbs |
| Pageload, navigation, fetch/XHR, web vitals, and manual spans | Instrumentation and tracing |
| Analytics, feature flags, session replay, heatmaps, and consent | Best practices |
| Source maps for a minified stack | Source maps |
Tracing, analytics, heatmaps, and session replay follow Project configuration. Until that document arrives, the page sends errors only.
Install
npm install @newtalaria/browserNode.js services use @newtalaria/node. Do not install @newtalaria/core on its own.
Initialization
Call Talaria.init once. Later calls are ignored.
import { Talaria } from '@newtalaria/browser';
Talaria.init({
dsn: 'https://ingest.newtalaria.com',
apiKey: 'tal_live_…',
release: '1.4.2',
commitSha: 'abc123',
minLevel: 'warning',
tags: { service: 'web' },
});Set remoteConfig: false only when this page should send errors and skip sdk/getConfig.
App init vs Project settings
| App init | Project settings |
|---|---|
dsn, apiKey, release, commitSha, minLevel, tags |
Tracing on/off and the traces sample rate |
networkErrorOrigins, beforeSend |
Analytics, heatmaps, and session replay |
publicAnalytics when the page has no banner Talaria reads |
Sample rates for replay |
API key
The key decides the environment. Each key is bound to development, test, staging, or production, and the prefix stays tal_live_. The server stamps that value on ingest. A deployed app that should report production uses a production key. Local install, including setup_project, uses a development key. Send release as a version or git SHA. The same string is the release you upload source maps for.
Verification
- Run the page with a development key.
- Call
Talaria.captureException(or throw fromwindow). - MCP
search_errorswithenvironment: development, or open Issues and switch the shell to Development.
Troubleshooting
A rejected key is cached for about 24 hours. Rotate the key and reload the page. Spans, replay, and heatmaps stay quiet until Project settings allow them and getConfig has refreshed (default about five minutes, or reload).