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

@lemydev/client-ts

v0.1.0

Published

Cliente TypeScript tipado para el servicio Soporte. Para integrar desde RentAR, Ahorro, NutriGo o cualquier app del ecosistema Lemy.

Readme

@lemydev/client-ts

Cliente TypeScript tipado para integrar el servicio Soporte Lemy desde cualquier app del ecosistema.

Instalación

pnpm add @lemydev/client-ts

Uso básico (server-side)

Importante: usá el cliente server-side (Route Handler, API route, server action). No expongas la API key al browser.

import { createSupportClient, captureClientMetadata } from "@lemydev/client-ts";

const support = createSupportClient({
  baseUrl: process.env.SOPORTE_API_URL!,
  apiKey: process.env.SOPORTE_API_KEY!,
});

// Crear ticket
const ticket = await support.createTicket(
  {
    type: "bug",
    subject: "No puedo iniciar sesión con Google",
    description: "Pasa cuando intento desde el celular.",
    files: [file],
    metadata: captureClientMetadata(process.env.NEXT_PUBLIC_APP_VERSION),
  },
  { userId: session.user.id, email: session.user.email },
);

API

| Método | Descripción | | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | | createTicket(input, identity?) | Crea un ticket con hasta 3 archivos (PNG/JPG/WebP ≤ 5MB, MP4 ≤ 20MB). Requiere identity con userId y email. | | getMyTickets({ cursor?, limit? }, identity?) | Lista paginada de tickets del reporter. Default limit=20, máx 100. | | getTicket(id, identity?) | Detalle del ticket (con attachments y mensajes públicos). Solo si pertenece al reporter. | | addMessage(ticketId, body, identity?) | Agrega un mensaje del usuario al hilo (siempre público). |

Podés pasar defaultIdentity al crear el cliente y omitirla en cada llamada.

Errores

Todos los métodos rechazan con SupportApiError:

import { SupportApiError } from "@lemydev/client-ts";

try {
  await support.createTicket(input, identity);
} catch (err) {
  if (err instanceof SupportApiError) {
    switch (err.code) {
      case "rate_limited": // Reintentar más tarde
      case "file_too_large": // Mostrar mensaje al usuario
      case "unsupported_format":
      case "validation":
      case "unauthorized": // Key revocada → notificar al equipo
      case "network": // Sin conexión
      case "server": // Bug del servicio
    }
  }
}

Patrón recomendado: proxy en tu backend

// app/api/support/tickets/route.ts (Next.js)
import { createSupportClient } from "@lemydev/client-ts";
import { auth } from "@/lib/auth";

const support = createSupportClient({
  baseUrl: process.env.SOPORTE_API_URL!,
  apiKey: process.env.SOPORTE_API_KEY!, // server-side only
});

export async function POST(req: Request) {
  const session = await auth();
  if (!session) return new Response("Unauthorized", { status: 401 });

  const fd = await req.formData();
  const ticket = await support.createTicket(
    {
      type: fd.get("type") as "bug" | "improvement",
      subject: String(fd.get("subject") ?? ""),
      description: String(fd.get("description") ?? ""),
      files: fd.getAll("files") as File[],
    },
    { userId: session.user.id, email: session.user.email },
  );
  return Response.json(ticket);
}

El cliente desde el browser hace fetch("/api/support/tickets", ...) sin saber nada de la API key.

Tipos exportados

Ticket, TicketSummary, PagedTickets, Attachment, Message, TicketType, TicketStatus, TicketPriority, Identity, CreateTicketInput, ListMyTicketsParams, ClientMetadata, SupportErrorCode.