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

@olimpo/error-client

v1.0.14

Published

Cliente de captura de errores e interacciones para aplicaciones Olimpo.

Readme

@olimpo/error-client

Cliente de captura de errores e interacciones para aplicaciones Olimpo.

Instalación

npm install @olimpo/error-client
# o
pnpm add @olimpo/error-client

Uso

Inicialización

import { OlimpoErrorClient } from "@olimpo/error-client";
import { SessionManager } from "@calimaco/base_v2";
import cfg from "./utils/Config";

// Inicializar con SessionManager (opcional)
const session = new SessionManager(cfg);
OlimpoErrorClient.init({
  sessionProvider: session,
  apiUrl: "https://api.example.com/api", // opcional
});

Captura de Errores

import { OlimpoErrorClient } from "@olimpo/error-client";

// Captura manual
OlimpoErrorClient.captureException({
  event_type: "error",
  message: "Error description",
  level: "error",
  fingerprint: "unique-error-id",
  stack_trace: [
    {
      file: "component.tsx",
      line: 42,
      function: "handleClick",
    },
  ],
});

// Captura segura (no lanza excepciones)
OlimpoErrorClient.captureExceptionSafe({
  event_type: "error",
  message: "Error description",
  level: "warning",
});

Hook de Captura de Errores

import { useCaptureError } from "@olimpo/error-client";

function MyComponent() {
  const { captureError } = useCaptureError();

  const handleAction = () => {
    try {
      // código que puede fallar
    } catch (error) {
      captureError(error, {
        event_type: "user_action_error",
        level: "error",
        tags: { action: "submit_form" },
      });
    }
  };
}

Captura de Interacciones

import { OlimpoErrorClient } from "@olimpo/error-client";

// Captura manual
OlimpoErrorClient.captureInteraction({
  event_type: "click",
  component_name: "LoginButton",
  action: "click",
  metadata: {
    page: "/login",
    element: "submit-btn",
  },
});

// Captura segura
OlimpoErrorClient.captureInteractionSafe({
  event_type: "page_view",
  component_name: "HomePage",
});

Hook de Captura de Interacciones

import { useCaptureInteraction } from "@olimpo/error-client";

function MyComponent() {
  const captureInteraction = useCaptureInteraction();

  const handleClick = () => {
    captureInteraction({
      event_type: "click",
      component_name: "ProductCard",
      action: "add_to_cart",
      metadata: { productId: "123" },
    });
  };
}

ErrorBoundary

import { ErrorBoundary } from "@olimpo/error-client";

function App() {
  return (
    <ErrorBoundary>
      <YourApp />
    </ErrorBoundary>
  );
}

API

OlimpoErrorClient

init(options)

Inicializa el cliente.

Opciones:

  • sessionProvider?: SessionProvider - Proveedor de sesión de usuario
  • apiUrl?: string - URL base de la API (por defecto usa REACT_APP_OLIMPO_API)

isInitialized(): boolean

Verifica si el cliente está inicializado.

captureException(payload): Promise<ErrorEventResponse>

Captura un error de forma asíncrona.

captureExceptionSafe(payload): void

Captura un error de forma segura (no lanza excepciones).

captureInteraction(payload): Promise<void>

Captura una interacción de usuario.

captureInteractionSafe(payload): void

Captura una interacción de forma segura.

isPWA(): boolean

Detecta si la aplicación se ejecuta como PWA.

getPlatformInfo()

Obtiene información de la plataforma (OS, navegador, tipo de dispositivo).

Variables de Entorno

REACT_APP_OLIMPO_API=https://api.example.com/api
REACT_APP_OLIMPO_CAPTURE_ERROR_PROJECT_SLUG=my-project
REACT_APP_OLIMPO_CAPTURE_ERROR_ENVIRONMENT_NAME=production
REACT_APP_OLIMPO_CAPTURE_ERROR_TOKEN=your-auth-token
REACT_APP_COUNTRY=PE

Tipos

interface SessionProvider {
  getUser: () => UserContext | undefined;
}

interface UserContext {
  user?: string;
  alias?: string;
  email?: string;
  mobile?: string;
  national_id?: string;
}

Licencia

Privado - Olimpo