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

keycae-ts

v1.0.0

Published

Official TypeScript & JavaScript SDK client for KeyCAE.ar impositive compliance API (ARCA)

Downloads

134

Readme

keycae-ts 🚀

Cliente SDK oficial en TypeScript y JavaScript para interactuar con la plataforma de KeyCAE.ar y emitir facturación electrónica oficial homologada ante ARCA (ex AFIP) de forma simple y resiliente.

Instalación

Instala el SDK en tu proyecto Node.js/TypeScript:

npm install keycae-ts
# O usando yarn / pnpm
yarn add keycae-ts
pnpm add keycae-ts

Inicio Rápido (Modelo A: Delegación Directa ⭐)

Esta es la forma recomendada por defecto. En minutos podés facturar sin lidiar con llaves privadas o subir archivos de certificados.

import { KeyCaeClient } from 'keycae-ts';

// 1. Inicializar el cliente con tu API Key
const client = new KeyCaeClient('sk_test_tu_api_key_aqui');

async function main() {
  try {
    // 2. Registrar la delegación (previamente debés adherir el servicio en el portal de ARCA al CUIT representante 20254459306)
    console.log('Iniciando delegación directa...');
    const delegation = await client.createDelegation({
      cuit: '20254459306',
      organization: 'Digital Media S.A.'
    });
    
    console.log(`Estado inicial de delegación: ${delegation.status}`);
    
    // 3. Emitir una factura electrónica homologada (con CAE y PDF)
    console.log('Emitiendo factura fiscal...');
    const invoice = await client.emitInvoice({
      cuit_emisor: '20254459306',
      punto_de_venta: 1,
      tipo_comprobante: 'C',
      receptor: {
        tipo_doc: 'DNI',
        nro_doc: '35987654'
      },
      conceptos: [
        {
          descripcion: 'Servicios de Consultoría de Software',
          precio: 150000.00
        }
      ]
    }, 'idempotency_key_factura_42'); // Idempotency key para prevenir duplicaciones de red
    
    console.log('¡Factura autorizada exitosamente!');
    console.log(`Comprobante: Nro. ${invoice.numero_factura}`);
    console.log(`CAE Otorgado: ${invoice.cae}`);
    console.log(`Vencimiento CAE: ${invoice.cae_vencimiento}`);
    console.log(`PDF de Impresión: ${invoice.url_pdf}`);
    console.log(`Código QR Fiscal: ${invoice.url_qr}`);
    
  } catch (error) {
    console.error('Error durante la operación:', error);
  }
}

main();

Notificaciones en Tiempo Real (Telegram Alerts)

Configurá tu bot de Telegram a través de la API para recibir alertas móviles al instante de cada comprobante emitido:

import { KeyCaeClient } from 'keycae-ts';

const client = new KeyCaeClient('sk_test_tu_api_key_aqui');

async function setupAlerts() {
  // Guardar configuración del Bot
  await client.saveTelegramSettings({
    telegram_bot_token: '123456789:ABCdefGhIjKlMnOpQrStUvWxYz_TOKEN',
    telegram_chat_id: '987654321'
  });
  
  // Consultar configuración actual (retorna enmascarada)
  const settings = await client.getTelegramSettings();
  console.log('Ajustes de alertas activos:', settings);
}

setupAlerts();

Licencia

MIT