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

@pakento/cms-sdk

v4.3.26

Published

SDK para conectar tiendas en línea con Pakento CMS

Readme

@pakento/cms-sdk

SDK para conectar tiendas en línea con Pakento CMS de forma rápida y sencilla.

Instalación

npm install @pakento/cms-sdk
# o
bun add @pakento/cms-sdk

Configuración

Agrega las siguientes variables de entorno a tu proyecto:

PAKENTO_CMS_BASE_URL=https://app.pakento.com
PAKENTO_API_KEY=tu-api-key-aqui

Uso

Hook useItems

import { useItems } from "@pakento/cms-sdk";

function ProductList() {
  const { items, loading, error, totalDocs, refetch } = useItems({
    page: 1,
    limit: 10,
  });

  if (loading) return <div>Cargando...</div>;
  if (error) return <div>Error: {error}</div>;

  return (
    <div>
      <h2>Productos ({totalDocs})</h2>
      {items.map((item) => (
        <div key={item.id}>
          <h3>{item.name}</h3>
          <p>Precio: {item.price_text}</p>
          <img src={item.cover_image_thumbnail_url} alt={item.name} />
        </div>
      ))}
      <button onClick={refetch}>Recargar</button>
    </div>
  );
}

API Service

import { pakentoCMSAPI } from "@pakento/cms-sdk";

// Uso directo del servicio
async function getProducts() {
  try {
    const response = await pakentoCMSAPI.getItems(1, 20);
    console.log(response.docs);
  } catch (error) {
    console.error("Error:", error.message);
  }
}

Tipos

import type { Item, ItemsResponse, UseItemsReturn } from "@pakento/cms-sdk";

Desarrollo

Configuración inicial

# Instalar dependencias
bun install

# Desarrollo con watch mode
bun run dev

# Build
bun run build

# Linting
bun run lint
bun run lint:fix

Desarrollo local con link

Para probar el SDK en tu aplicación local:

  1. En el directorio del SDK:
bun run build
bun link
  1. En tu aplicación NextJS:
bun link @pakento/cms-sdk
  1. Cuando hagas cambios en el SDK:
bun run build

Los cambios se reflejarán automáticamente en tu app.

Para desconectar el link:

# En tu aplicación
bun unlink @pakento/cms-sdk

# Reinstalar desde NPM
bun add @pakento/cms-sdk

Publicación

Variables de entorno necesarias

NPM_TOKEN=tu-npm-token-aqui

Publicación automática

bun run release

Este comando te preguntará qué tipo de versión quieres publicar y ejecutará:

  • Lint
  • Build
  • Commit
  • Push
  • Publish

Publicación manual

# Cambiar versión manualmente en package.json
# Luego:
bun run build
npm publish --access public

Tipos de versión

  • patch: 1.0.0 → 1.0.1 (bug fixes)
  • minor: 1.0.0 → 1.1.0 (nuevas features)
  • major: 1.0.0 → 2.0.0 (breaking changes)
  • custom: Especificar versión manualmente
  • skip: No cambiar versión

Estructura del proyecto

src/
├── hooks/
│   └── useItems.ts      # Hook principal para obtener items
├── services/
│   └── api.ts           # Cliente API con Axios
├── types/
│   └── index.ts         # Definiciones de tipos TypeScript
└── index.ts             # Exportaciones principales

Manejo de errores

El SDK incluye manejo de errores para:

  • API Key inválida (401)
  • Endpoint no encontrado (404)
  • Errores del servidor (5xx)
  • Errores de conexión
  • Errores de GraphQL

Licencia

MIT

.build

EJECUCION DE PREUBAS:

npx ts-node -P tsconfig.examples.json examples/testItems.ts

npx ts-node -P tsconfig.examples.json examples/testEntity.ts