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

@r2digisolutions/verifactu

v0.2.2

Published

Motor VERI*FACTU (AEAT): hash SHA-256, XML, QR, SOAP mTLS y cifrado del certificado

Readme

@r2digisolutions/verifactu

Motor VERI*FACTU (SIF / AEAT) para productos Evoteg: hash SHA-256 encadenado, XML de registro, QR de cotejo, SOAP mTLS y cifrado del certificado .p12.

No es un formato de factura (Facturae). Es el control fiscal del software (RD 1007/2023 + Orden HAC/1177/2024). Hacienda no homologa programas: el productor autocertifica cada SIF con una declaración responsable.

Qué cubre / qué no

| Sí | No | | ------------------------------------------- | ---------------------------- | | Registro de alta / anulación | Persistencia (Drizzle, cola) | | Huella SHA-256 spec AEAT v0.1.2 | UI de ajustes o facturas | | XML + envelope SOAP | TicketBAI / Navarra / SII | | QR de cotejo (la huella no va en el QR) | Facturae / Crea y Crece | | mTLS con el .p12 del obligado | Certificado del productor |

Cada producto es un SIF distinto (Atom id 01, CRM id 02). El productor es Evoteg. El obligado tributario (gym / empresa) factura con su CIF y su certificado.

Instalación

pnpm add @r2digisolutions/verifactu

El producto debe pasar:

  • Identidad del SIF (name, id, version)
  • NIF y nombre del productor (VERIFACTU_PRODUCER_NIF / VERIFACTU_PRODUCER_NAME)
  • Entorno AEAT (pre | prod)
  • Clave de cifrado (VERIFACTU_ENCRYPTION_KEY: 64 hex o secreto ≥ 32)

Uso

import { Verifactu } from '@r2digisolutions/verifactu';

const verifactu = new Verifactu({
	sif: { name: 'CRM', id: '02', version: '1.0.0' },
	producer: { name: 'Evoteg', nif: process.env.VERIFACTU_PRODUCER_NIF! },
	env: 'pre',
	encryptionKey: process.env.VERIFACTU_ENCRYPTION_KEY!
});

const huella = verifactu.hashAlta({ /* campos AEAT */ });
const xml = verifactu.buildAltaXml({ /* … */, huella });
const qr = verifactu.qrUrl({ nif, numSerie, fechaExpedicion, totalCents });
await verifactu.submitSoap({
	soapXml: verifactu.wrapSoap({ emisorNombre, emisorNif, registroInner: xml }),
	pfx,
	passphrase
});

Helpers estáticos: Verifactu.resolveDocumentType, Verifactu.centsToAeatAmount, Verifactu.formatFechaExpedicion, Verifactu.interpretAeatResponse, Verifactu.jurisdictionBlocks.

Specs

Portal desarrolladores AEAT — SIF / VERI*FACTU

Desarrollo

pnpm install
pnpm test:unit -- --run
pnpm check
pnpm prepack

Publicación

El versionado usa bumpp. Un tag v* dispara GitHub Actions, que publica en npm con Trusted Publishing (OIDC).

Requisitos previos (una sola vez)

  1. Acceso al scope npm @r2digisolutions
  2. En npmjs.com → Trusted Publisher:
    • Provider: GitHub Actions
    • Organization / user: r2digitalsolutions
    • Repository: verifactu
    • Workflow filename: publish.yml
    • Environment: production (debe coincidir con el job de CI)

Subir versión

Working tree limpio, en main:

pnpm release:patch   # 0.1.3 → 0.1.4
pnpm release:minor   # 0.1.3 → 0.2.0
pnpm release:major   # 0.1.3 → 1.0.0

# O interactivo:
pnpm release

Bump de versión, commit, tag vX.Y.Z y push. CI publica el paquete y crea el GitHub Release.

Creado con sv create --template library.