@extn/segi-nestjs
v0.2.0
Published
NestJS integration for the segi error monitoring service
Readme
@extn/segi-nestjs
Install
pnpm add @extn/segi-nestjsUse
In app.module.ts:
import { Module } from "@nestjs/common";
import { SegiModule } from "@extn/segi-nestjs";
@Module({
imports: [
SegiModule.forRoot({
publicKey: process.env.SEGI_KEY!,
environment: process.env.NODE_ENV,
release: process.env.GIT_SHA,
}),
],
})
export class AppModule {}Register the global filter in main.ts:
import { SegiExceptionFilter } from "@extn/segi-nestjs";
const app = await NestFactory.create(AppModule);
app.useGlobalFilters(new SegiExceptionFilter());
await app.listen(3000);Every unhandled exception is forwarded to segi while still surfacing the original error to the client.
Session recording
Session recording is a browser-side feature — wire it in with @extn/segi-js or @extn/segi-nextjs. The NestJS package is server-only and never touches the DOM. Server-side it does, however, expose an admin helper to fetch recordings programmatically (e.g. to attach a replay link to a Slack alert):
const recording = await this.segi.adminApi.recordings.find({ projectId, sessionUid });
// recording.replayUrl is a signed admin URL with the rrweb playerRecording quotas are per organization plan (Free 10 / Team 30 / Enterprise ∞ per project per month) — see docs/12-session-recording.md and docs/13-plans-and-billing.md.
Docs
Licence
Copyright (c) 2026 Extension Co., Ltd. All rights reserved. Use of this package is governed by the LICENSE file in this package and the segi service Terms of Service at https://segi.extn.ai/tnc — it is not open source.
