npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@derwinjs/dashboard-fallback

v0.18.0

Published

Tier 3 fallback hosted dashboard — Next.js subapp for consumers without a UI to embed into.

Readme

@derwinjs/dashboard-fallback

Tier-3 hosted Next.js subapp for consumers without a packages/ui/ workspace to embed Derwin's Tier-1/Tier-2 components into. Per ADR-0004, this is the last-resort tier: if your team can embed Derwin's React components directly (Tier 1) or build a thin custom dashboard against @derwinjs/sdk (Tier 2), prefer those. The fallback exists for consumers whose admin stack can't host Derwin's UI directly — Side Piece's Brain-tRPC-coupled admin is the load- bearing example (per ADR-005).

Install

pnpm add @derwinjs/dashboard-fallback
# or:
npm i @derwinjs/dashboard-fallback

Wiring (instrumentation.ts)

The package exports configuration helpers consumers call once at boot, before any route handlers fire. Typical setup in your Next.js app's instrumentation.ts:

import { createClerkAuthAdapter } from '@derwinjs/adapters';
import { configureDashboardApiClient, setDashboardAuthAdapter } from '@derwinjs/dashboard-fallback';

export function register() {
  // 1. Wire the Derwin API client (where the dashboard reads QA tickets from).
  configureDashboardApiClient({
    baseUrl: process.env.DERWIN_API_URL!,
    bearerToken: process.env.DERWIN_API_TOKEN!,
  });

  // 2. Wire the auth adapter (matches QAAuthAdapter SDK contract).
  setDashboardAuthAdapter(
    createClerkAuthAdapter({
      // ...your Clerk config; see packages/adapters/src/auth/clerk.ts
    }),
  );
}

Routes

The Next.js App Router tree lives at app/. Routes are documented in their respective page.tsx files; the load-bearing ones:

| Route | Purpose | | ------------------------------------------ | ------------------------------------------------------ | | / | Project picker (the dashboard's landing) | | /projects/[projectId] | Project overview — open tickets, mode, recent activity | | /projects/[projectId]/tickets/[ticketId] | Single-ticket deep view with audit trail | | /projects/[projectId]/mode | OBSERVE / TICKET_ONLY / AUTHOR / AUTO mode controls | | /projects/[projectId]/policy | Policy editor (risk tiers, classification overrides) | | /projects/[projectId]/profile | ProjectProfile editor (ontology, glossary, surfaces) | | /projects/[projectId]/health | Trust scores + kill-switch states |

Deployment patterns

The Tier-3 fallback supports three distribution shapes:

A — Standalone Next.js deploy (recommended for first-time consumers)

Run the dashboard as its own Next.js app on Vercel/Cloudflare/Fly.io. The package ships its complete Next.js tree (app/, next.config.mjs, tsconfig.json); you wire it via instrumentation.ts and deploy.

# Boot a new Next.js app and use the fallback as the entry tree:
npx create-next-app@latest my-derwin-dashboard --typescript --app
cd my-derwin-dashboard
pnpm add @derwinjs/dashboard-fallback @derwinjs/adapters @derwinjs/sdk
# Replace the generated app/ with re-exports from @derwinjs/dashboard-fallback/app,
# add your instrumentation.ts, deploy.

B — Re-export from your existing Next.js admin app

If you already run a Next.js admin and want to mount Derwin's dashboard at a sub-route (e.g., /qa), import the routes from @derwinjs/dashboard-fallback into a corresponding directory in your app/ tree.

// app/qa/page.tsx
export { default } from '@derwinjs/dashboard-fallback/app/page';

This is Side Piece's pattern — the admin lives at side-piece-admin.vercel.app and Derwin's dashboard mounts at /qa inside it.

C — Hosted service (Sprint 19+ roadmap)

A Vercel-template variant where Derwin runs the dashboard for the consumer at https://qa.<consumer-domain> is on the Sprint 19+ roadmap. Operator-deployed, consumer points DNS at it, no install needed. Out of scope for this version.

Theming

Each consumer gets per-project theming via PROJECT_THEMES. Side Piece is the first registered theme (luxury food / chef-curated palette). To add a theme for a new consumer, edit src/lib/theming/project-themes.ts and contribute the entry back upstream.

import { PROJECT_THEMES } from '@derwinjs/dashboard-fallback';
const sidePieceTheme = PROJECT_THEMES['side-piece'];

For programmatic theming at the route boundary, wrap children in <ProjectThemeProvider>:

import { ProjectThemeProvider } from '@derwinjs/dashboard-fallback';

<ProjectThemeProvider projectId="side-piece">
  {children}
</ProjectThemeProvider>

Required peer packages

The dashboard depends on:

  • @derwinjs/sdk — Derwin's contracts (QAAuthAdapter, etc.)
  • @derwinjs/adapters — concrete auth/ticket/runner/repo implementations
  • @derwinjs/ui — Derwin's shared React components
  • @clerk/nextjs — current default auth provider (swap via the auth adapter)
  • next^15.5.18 (App Router conventions)
  • react / react-dom^19.2.6

All are listed as dependencies in package.json so a single pnpm add @derwinjs/dashboard-fallback brings the full set.

Versioning

The package follows Derwin's sprint cadence — minor bumps each sprint that touches the dashboard. Sprint 18 (v0.18.0) is the first published version.

See also