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

@trustseal/sdk

v1.0.0

Published

SDK officiel TrustSeal — certification et vérification cryptographique de documents

Readme

@trustseal/sdk

SDK officiel TrustSeal — certification et vérification cryptographique de documents sur blockchain Polygon.

Installation

npm install @trustseal/sdk

Usage rapide

import TrustSeal from '@trustseal/sdk'

// Vérification (public, sans API key)
const ts = new TrustSeal()
const result = await ts.verify(fileBuffer)

if (result.valid) {
  console.log('Certifié par :', result.organisme?.name)
  console.log('Date         :', result.certificate?.tsaTimestamp)
  console.log('Transaction  :', result.certificate?.txHash)
} else {
  console.log('Document non certifié')
}

Vérification

Par fichier (hash calculé localement)

import TrustSeal from '@trustseal/sdk'
import fs from 'fs'

const ts = new TrustSeal()
const file = fs.readFileSync('diplome.pdf')
const result = await ts.verify(file)

Par hash SHA-256

const result = await ts.verify('a3f9d2c1...')

Par ID de certificat

const result = await ts.verify('3f2a9d1c-4b5e-6f7a-8b9c-0d1e2f3a4b5c')

Dans le navigateur

<script type="module">
import TrustSeal from 'https://esm.sh/@trustseal/sdk'
const ts = new TrustSeal()
const [file] = event.target.files
const result = await ts.verify(file)
console.log(result.valid)
</script>

Certification

Requiert une API key disponible dans votre dashboard TrustSeal.

import TrustSeal from '@trustseal/sdk'
import fs from 'fs'

const ts = new TrustSeal({ apiKey: 'ts_live_xxxxxxxxxxxx' })

const file = fs.readFileSync('document.pdf')
const cert = await ts.certify(file, {
  label: 'Décret n°2026-441',
  metadata: { ref: 'DEC-2026-441', ministere: 'Primature' },
})

console.log('Certificat :', cert.certificate.id)
console.log('Voir sur   :', cert.qrUrl)

Avec version history

const certV1 = await ts.certify(fileV1, { versionLabel: 'Version initiale' })

const certV2 = await ts.certify(fileV2, {
  parentCertId: certV1.certificate.id,
  versionLabel: 'Révision mars 2026',
})

Certification batch

import TrustSeal from '@trustseal/sdk'
import fs from 'fs'

const ts = new TrustSeal({ apiKey: 'ts_live_xxxxxxxxxxxx' })

const csv = `filename,label,nom,prenom
diplomes/DIALLO_M.pdf,Licence Informatique,DIALLO,Mamadou
diplomes/FALL_A.pdf,Master Finance,FALL,Aminata`

const zip = fs.readFileSync('diplomes.zip')

// Lancer le batch
const job = await ts.batch({ csv, zip })
console.log(`Batch lancé : ${job.totalItems} documents`)

// Attendre la fin avec callback de progression
const result = await ts.waitForBatch(job.jobId, {
  pollInterval: 2000,
  onProgress: (j) => console.log(`${j.progress}% — ${j.successCount} ok`),
})

console.log(`Terminé : ${result.successCount} certifiés, ${result.errorCount} erreurs`)

// Télécharger le rapport
const csvReport = await ts.getBatchReport(job.jobId)
fs.writeFileSync('rapport.csv', csvReport)

TrustSealVerifier (vérification seule)

Pour les cas où vous voulez seulement vérifier, sans jamais certifier :

import { TrustSealVerifier } from '@trustseal/sdk'

const verifier = new TrustSealVerifier()

// Hash d'un fichier sans l'envoyer
const hash = await verifier.hash(fileBuffer)
console.log('SHA-256 :', hash)

// Vérifier
const result = await verifier.verify(fileBuffer)

Configuration

const ts = new TrustSeal({
  apiKey:    'ts_live_xxxxxxxxxxxx',  // Requis pour certify/batch
  baseUrl:   'https://api-ts.e-sotop.com',  // URL de l'API
  timeout:   30_000,                  // Timeout en ms
  originKey: 'abc123...',             // Clé origin pour analytics widget
})

Gestion d'erreurs

import TrustSeal, { TrustSealError } from '@trustseal/sdk'

try {
  const result = await ts.certify(file)
} catch (e) {
  if (e instanceof TrustSealError) {
    console.error('Code  :', e.code)        // ex: 'DOCUMENT_DEJA_CERTIFIE'
    console.error('HTTP  :', e.statusCode)   // ex: 409
    console.error('Msg   :', e.message)
  }
}

Codes d'erreur

| Code | Description | |------|-------------| | API_KEY_REQUIRED | API key manquante pour cette opération | | DOCUMENT_DEJA_CERTIFIE | Document déjà certifié (hash identique) | | QUOTA_INSUFFISANT | Quota journalier dépassé | | NOT_FOUND | Certificat introuvable | | BATCH_TIMEOUT | waitForBatch() a dépassé le timeout |

Compatibilité

  • Node.js 18+
  • Navigateurs modernes (Chrome, Firefox, Safari, Edge)
  • React Native (via fetch natif)
  • TypeScript 5+

Made with ❤️ by E-Sotop Services · Dakar, Sénégal