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

nodda-client

v1.2.1

Published

Cliente oficial de la API de Nodda para emitir y consultar facturas VERI*FACTU (AEAT).

Readme

nodda-client (Node.js)

Cliente oficial de la API de Nodda para emitir y consultar facturas VERI*FACTU de la Agencia Tributaria (AEAT) desde tu propio programa (ERP, tienda online, TPV…).

Nodda se encarga de la firma con tu certificado, del XML, de la cadena de huellas y del envío a la AEAT: tú solo mandas los datos de la factura en JSON.

Instalación

npm install nodda-client

Requisitos: Node.js 18 o superior. Sin dependencias.

Antes de empezar

  1. Crea tu cuenta en el portal de Nodda y da de alta tu empresa (NIF y certificado digital).
  2. Genera tu clave API en el portal → API keys.
  3. Usa la dirección del entorno con su clave:

| Entorno | Dirección | Uso | |---|---|---| | Pruebas | https://sandbox.nodda.es | Envía al entorno de pruebas de la AEAT, sin validez fiscal | | Producción | https://api.nodda.es | Facturas reales |

La clave de pruebas no sirve en producción, ni al revés.

Uso

import { NoddaClient } from 'nodda-client';

const nodda = new NoddaClient('https://sandbox.nodda.es', process.env.NODDA_API_KEY);

const r = await nodda.crearFactura({
  series: '2026', number: '0001', issueDate: '2026-11-03', invoiceType: 'F1',
  description: 'Servicios de consultoría', taxRegimeKey: '01', operationQualification: 'S1',
  taxBase: '100.00', taxRate: '21', taxAmount: '21.00', totalAmount: '121.00',
  recipients: [{ nif: 'B12345674', name: 'Cliente Demo SL' }],
});
// r.status === 'queued': la API responde al momento; la AEAT, unos segundos después.

const estado = await nodda.consultarEstado(r.id); // queued, sent, accepted_with_errors o permanently_failed

number es el número de la factura dentro de su serie (sin huecos ni repeticiones). Puedes omitirlo si la serie tiene numeración automática configurada (en el portal, Empresas → series de numeración, o con PUT /v1/emisores/{id}/series); si no, la API responde series_not_configured.

Si tu clave da acceso a varias empresas (NIF), indica cuál en el parámetro nif de cada método. Puedes asociar la factura a un centro de coste enviando costCenterId en los datos.

Métodos

| Método | Endpoint | |---|---| | crearFactura(datos, nif?) | POST /v1/invoices | | consultarEstado(id, nif?) | GET /v1/invoices/{id} | | listarFacturas(filtros?, nif?) | GET /v1/invoices (status, type, from, to, limit, offset, include) | | cancelarFactura(id, datos?, nif?) | POST /v1/invoices/{id}/cancel | | reintentarFactura(id, tipo?, nif?) | POST /v1/invoices/{id}/retry | | obtenerUrlQr(id, nif?) / obtenerImagenQr(id, nif?) | GET /v1/invoices/{id}/qr | | estadoSistema(nif?) | GET /v1/status | | obtenerPerfil() | GET /v1/client | | configurarWebhook(url, nif?) / quitarWebhook(nif?) | PUT / DELETE /v1/webhooks | | NoddaClient.verificarFirmaWebhook(cuerpo, firma, secreto) | Comprueba la firma de un aviso |

Avisos (webhooks)

En lugar de consultar el estado de cada factura, Nodda puede avisar a tu servidor cuando la AEAT responde. Configura la URL con configurarWebhook(url) (la respuesta trae el secreto una sola vez: guárdalo) y, en tu endpoint, comprueba la firma antes de confiar en el aviso:

// cuerpo: el cuerpo tal cual llega (Buffer o texto); firma: cabecera X-Nodda-Signature
if (!NoddaClient.verificarFirmaWebhook(cuerpo, req.get('X-Nodda-Signature'), process.env.NODDA_WEBHOOK_SECRET)) {
  return res.sendStatus(401);
}

El cuerpo trae id (número de factura), status (sent, accepted_with_errors o permanently_failed), razon, eventId y los datos del acuse de la AEAT. Responde con un código 2xx; si no, Nodda lo reintenta.

Errores

Si la API responde con un error, se lanza NoddaApiException con el código HTTP y un código estable (por ejemplo invalid_request, business_rule_violation, certificate_not_configured). Si no hubo respuesta (fallo de red), se lanza NoddaException: puedes reintentar la misma petición.

Documentación

Guía completa, campos de cada petición y códigos de error: https://app.nodda.es/developers/introduccion Referencia OpenAPI: https://api.nodda.es/openapi.json

Soporte: [email protected]

Licencia

MIT