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 🙏

© 2025 – Pkg Stats / Ryan Hefner

d4sign-node

v0.0.3

Published

Node.js/TypeScript library for interacting with the D4Sign digital signature API

Readme

D4Sign Node.js Library

A Node.js/TypeScript library for interacting with the D4Sign digital signature API.

Disclaimer: This library is not an official D4Sign API client. It is a community-driven implementation and is not affiliated with or endorsed by D4Sign.

Official release in NPM schedule to 09/05/2025 07:00 PM (UTC-3).

Installation

npm install d4sign-node

Usage

Basic Setup

import { D4Sign } from 'd4sign-node';

// Create a new D4Sign client
const client = new D4Sign('your-api-key', 'your-crypt-key');

// Get account information
client.getAccount()
  .then(account => {
    console.log('Account:', account);
  })
  .catch(error => {
    console.error('Error:', error);
  });

Environment Variables

You can also use environment variables for configuration:

// .env file
D4SIGN_API_KEY=your-api-key
D4SIGN_CRYPT_KEY=your-crypt-key
// Load environment variables
import { D4Sign } from 'd4sign-node';
import * as dotenv from 'dotenv';

dotenv.config();

const client = new D4Sign(
  process.env.D4SIGN_API_KEY!,
  process.env.D4SIGN_CRYPT_KEY
);

API Reference

Client Initialization

const client = new D4Sign(
  apiKey: string,
  cryptKey?: string,
  options?: {
    apiUrl?: string;
    timeout?: number;
  }
);

Account

// Get account information
const account = await client.getAccount();

Documents

// Find documents (PHP: find)
const documents = await client.documents.find();

// Upload a document (PHP: upload)
const uploadedDocument = await client.documents.upload('uuid-safe', '/path/to/file.pdf', 'uuid-folder');

// Cancel a document
await client.documents.cancel('document-uuid', 'optional comment');

// List signatures for a document
const signatures = await client.signatures.listSignatures('document-uuid');

// Add info to a signer
await client.signatures.addInfo('document-uuid', '[email protected]', 'Signer Name', '12345678900', '1990-01-01');

// Resend document to a signer
await client.signatures.resend('document-uuid', '[email protected]');

Webhooks

// Add a webhook to a document
await client.webhooks.add('document-uuid', 'https://your-webhook-url.com');

// List webhooks for a document
const webhooks = await client.webhooks.list('document-uuid');

Certificates

// Find certificates for a document and signer
const certificates = await client.certificates.find('document-uuid', 'key-signer');

// Add a certificate to a document for a signer
await client.certificates.add('document-uuid', 'key-signer', 'document_type');

Error Handling

The library throws D4SignError for API errors:

import { D4Sign, D4SignError } from 'd4sign-node';

const client = new D4Sign('your-api-key', 'your-crypt-key');

try {
  const account = await client.getAccount();
  console.log('Account:', account);
} catch (error) {
  if (error instanceof D4SignError) {
    console.error('D4Sign API Error:', error.message);
    console.error('Status:', error.status);
    console.error('Data:', error.data);
  } else {
    console.error('Unexpected error:', error);
  }
}

License

MIT