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

@dex-monit/observability-contracts

v1.0.3

Published

TypeScript contracts and interfaces for Dex Monitoring SDK

Readme

@dex-monit/observability-contracts

TypeScript contracts and interfaces for the Dex Monitoring platform.

Installation

npm install @dex-monit/observability-contracts

Overview

This package provides all the TypeScript interfaces and types used by the Dex Monitoring SDKs and platform. It ensures type safety and consistency across all integrations.

Interfaces

Core Types

Severity

type Severity = 'debug' | 'info' | 'warning' | 'error' | 'fatal';

IssueStatus

type IssueStatus = 'unresolved' | 'resolved' | 'ignored' | 'archived';

Error Events

ErrorEvent

The main structure for reporting errors to the monitoring platform.

interface ErrorEvent {
  eventId: string;           // Unique event identifier
  timestamp: string;         // ISO 8601 timestamp
  level: Severity;           // Error severity
  platform: string;          // 'node', 'browser', 'react-native'
  sdk: { name: string; version: string };
  project: string;           // Project identifier
  environment: string;       // 'production', 'staging', 'development'
  serverName?: string;
  release?: string;
  message: string;           // Error message
  exception?: ExceptionDetails;
  breadcrumbs?: Breadcrumb[];
  requestId?: string;
  transactionId?: string;
  contexts?: EventContext;
  fingerprint?: string[];
}

ExceptionDetails

interface ExceptionDetails {
  type: string;              // Error type (e.g., 'TypeError')
  value: string;             // Error message
  stacktrace?: StackFrame[];
}

StackFrame

interface StackFrame {
  filename: string;
  function: string;
  lineno: number;
  colno: number;
  context?: string[];        // Source code context
}

Log Events

LogEvent

interface LogEvent {
  id: string;
  timestamp: string;
  level: Severity;
  message: string;
  project: string;
  environment: string;
  serverName?: string;
  requestId?: string;
  transactionId?: string;
  data?: Record<string, unknown>;
  tags?: Record<string, string>;
}

Context Interfaces

EventContext

interface EventContext {
  client?: ClientContext;    // Browser info
  runtime?: RuntimeContext;  // Node.js version, etc.
  os?: OSContext;            // Operating system
  device?: DeviceContext;    // Server/device info
  app?: AppContext;          // Application metrics
  request?: RequestContext;  // HTTP request details
  user?: UserContext;        // User information
  tags?: Record<string, string>;
  extra?: Record<string, unknown>;
}

UserContext

interface UserContext {
  id?: string;
  email?: string;
  username?: string;
  ipAddress?: string;
}

RequestContext

interface RequestContext {
  url?: string;
  method?: string;
  headers?: Record<string, string>;
  query?: Record<string, string>;
  body?: Record<string, unknown>;
  cookies?: Record<string, string>;
  data?: Record<string, unknown>;
}

Issues

Issue

interface Issue {
  id: string;
  shortId: string;           // Human-readable ID (e.g., 'PROJ-123')
  title: string;
  culprit?: string;          // Error origin
  project: string;
  status: IssueStatus;
  level: Severity;
  firstSeen: string;
  lastSeen: string;
  count: number;             // Total events
  userCount: number;         // Affected users
  platform: string;
  fingerprint: string[];
  metadata?: { type?: string; value?: string; filename?: string; function?: string };
  assignedTo?: string;
  tags?: Record<string, string>;
}

API Types

PaginatedResponse

interface PaginatedResponse<T> {
  data: T[];
  meta: {
    page: number;
    pageSize: number;
    total: number;
    totalPages: number;
  };
}

ApiResponse

interface ApiResponse<T> {
  success: boolean;
  data?: T;
  error?: {
    code: string;
    message: string;
    details?: unknown;
  };
}

Query Parameters

ListIssuesQuery

interface ListIssuesQuery {
  project?: string;
  status?: IssueStatus;
  level?: Severity;
  page?: number;
  pageSize?: number;
  sortBy?: 'lastSeen' | 'firstSeen' | 'count' | 'userCount';
  sortOrder?: 'asc' | 'desc';
}

ListLogsQuery

interface ListLogsQuery {
  project?: string;
  level?: Severity;
  requestId?: string;
  transactionId?: string;
  from?: string;
  to?: string;
  search?: string;
  page?: number;
  pageSize?: number;
}

Usage Example

import type { 
  ErrorEvent, 
  LogEvent, 
  Severity,
  UserContext 
} from '@dex-monit/observability-contracts';

// Type-safe error event
const errorEvent: ErrorEvent = {
  eventId: 'abc123',
  timestamp: new Date().toISOString(),
  level: 'error',
  platform: 'node',
  sdk: { name: 'sdk-node', version: '1.0.0' },
  project: 'my-project',
  environment: 'production',
  message: 'Something went wrong',
  contexts: {
    user: {
      id: 'user-123',
      email: '[email protected]',
    } as UserContext,
  },
};

License

MIT