@dudousxd/nestjs-telescope-ui (dashboard)
The bundled dashboard SPA served by a NestJS module — plus the composable React components, hooks, and typed client to build your own admin.
pnpm add @dudousxd/nestjs-telescope-uiA visual dashboard for Telescope — a bundled React SPA served by a NestJS module. No frontend dependency is imposed on your app: React and Tailwind are bundled into static assets at publish time; your app just serves them. Works on Express and Fastify.
Turnkey dashboard
import { Module } from '@nestjs/common';
import { TelescopeModule } from '@dudousxd/nestjs-telescope';
import { TelescopeUiModule } from '@dudousxd/nestjs-telescope-ui';
@Module({
imports: [TelescopeModule.forRoot(), TelescopeUiModule.forRoot()],
})
export class AppModule {}Open /telescope. The dashboard polls /telescope/api/* and shows captured entries (type tabs + live polling) and, on an entry, the correlated batch — the request and everything it caused. See the full dashboard tour.
Build your own (composable)
The same pieces are exported so you can drop them into your own admin:
import { TelescopeProvider, useEntries, EntriesTable } from '@dudousxd/nestjs-telescope-ui/react';
function MyEntries() {
const { data } = useEntries({ type: 'query' });
return <EntriesTable entries={data?.data ?? []} />;
}
// wrap your tree once in <TelescopeProvider> (defaults to the /telescope/api base)Or just the typed client (no React):
import { createTelescopeClient } from '@dudousxd/nestjs-telescope-ui/client';
const telescope = createTelescopeClient({ baseUrl: '/telescope/api' });
const page = await telescope.entries({ type: 'job' });Peer dependencies
The module (.) needs @nestjs/common / @nestjs/core (>= 11, including 12). /react needs react, react-dom, and @tanstack/react-query — but only if you import it; they're optional peers. The turnkey dashboard bundles its own copies, so a plain TelescopeUiModule.forRoot() adds no React to your app.
Protecting the page
authorize decides who may open the page, the same option (and usually the same value) as on TelescopeModule. Or set routes: false and extend the exported TelescopeUiController:
TelescopeUiModule.forRoot({
authorize: (ctx) => ctx.switchToHttp().getRequest().user?.isAdmin === true,
});
// or: routes: false + path: 'ops/telescope', and (ABOVE your auth guard, so it runs first)
@Controller('ops/telescope')
@UseConsoleAuthorize()
@UseGuards(AuthGuard)
class ConsolePage extends TelescopeUiController {}A denied navigation gets an "Access denied" page (403), a "Sign in required" page (401), or a 302 when the check returns { redirectTo: '/login' }. A full-page navigation carries your app's cookies, not an Authorization header, so check a session here. Inside the dashboard, a 401 with redirectTo from the API is followed and a 403 shows an access-denied screen. Without authorize the page is open outside production and answers 403 in production. See Protecting the routes.
@dudousxd/nestjs-telescope (core)
The core module — request + exception watchers, the recorder, ALS correlation, the zero-config SQLite store, the headless API, the gate, and the pruner.
Watchers
Query watchers (MikroORM, TypeORM, Prisma, Drizzle) and behavioral watchers (mail, cache, schedule, events, logs, redis, model) — each a small package you add to the watchers array.