Next.js SDK
One install for Next 14–16. Import @newtalaria/nextjs/client, /server, /edge, and /config so Node http never lands in the browser bundle.
Built on React and Node. withTalariaConfig does not upload source maps — Talaria has no symbolication worker. Set release / commitSha instead.
Install
npm install @newtalaria/nextjsExample app
Clone the SDK repo and run the Next.js 15 App Router demo. It installs @newtalaria/nextjs from npm.
git clone https://github.com/newtalaria/talaria-js-sdk.git
cd talaria-js-sdk/examples/next
cp .env.example .env.local
npm install
npm run devClient
// instrumentation-client.ts
import { initClient } from '@newtalaria/nextjs/client';
initClient({
dsn: process.env.NEXT_PUBLIC_TALARIA_DSN!,
apiKey: process.env.NEXT_PUBLIC_TALARIA_API_KEY!,
environment: process.env.NEXT_PUBLIC_TALARIA_ENVIRONMENT ?? 'production',
replaysOnErrorSampleRate: 1,
});Static export
Sites with output: "export" have no Node or edge runtime at request time. Use @newtalaria/nextjs/client from instrumentation-client.ts plus app/global-error.tsx. Server and edge init, onRequestError, withServerAction, and withRouteHandler do not run on a static host.
Server
Wrap Server Actions with withServerAction and Route Handlers with withRouteHandler. Add app/global-error.tsx as a client component that calls captureException.
// instrumentation.ts
export async function register() {
if (process.env.NEXT_RUNTIME === 'nodejs') {
await import('./talaria.server.config');
}
}
export { captureRequestError as onRequestError } from '@newtalaria/nextjs/server';next.config
// next.config.ts
import { withTalariaConfig } from '@newtalaria/nextjs/config';
export default withTalariaConfig({
// your Next config
});Product analytics
The same client sends product analytics — track, page, screen, and identify — once analytics is enabled on the project and you opt in. Setup for this platform is in the analytics guide.
Troubleshooting
- 401/403 — check API key and that it belongs to the target project.
- No issue appears — confirm environment filter in the dashboard.
- Rejected events — validate JSON shape against the API overview.