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

sendcraft-sdk

v1.1.0

Published

Official SendCraft SDK for Node.js - Send transactional emails and campaigns via the SendCraft API

Readme

SendCraft Node.js SDK

Official Node.js SDK for SendCraft — send transactional emails and campaigns via the SendCraft API.

Installation

npm install sendcraft-sdk

Quick Start

const SendCraft = require('sendcraft-sdk');

const client = new SendCraft({
  apiKey: process.env.SENDCRAFT_API_KEY
});

const result = await client.sendEmail({
  toEmail: '[email protected]',
  subject: 'Welcome to SendCraft',
  htmlContent: '<h1>Welcome!</h1><p>Thanks for signing up.</p>',
  fromEmail: '[email protected]',
  fromName: 'Your Company'
});

console.log('Email sent:', result);

Features

  • Send single emails
  • Send bulk emails
  • Schedule emails for later
  • Create & manage campaigns
  • Email templates
  • Subscriber management
  • Webhook configuration
  • Analytics & reporting
  • TypeScript support
  • Full error handling

Usage Examples

Send Email

await client.sendEmail({
  toEmail: '[email protected]',
  subject: 'Hello!',
  htmlContent: '<h1>Hello!</h1>',
  fromEmail: '[email protected]'
});

Send Bulk Emails

await client.sendBulkEmails({
  emails: [
    { toEmail: '[email protected]', toName: 'John Doe' },
    { toEmail: '[email protected]', toName: 'Jane Smith' }
  ],
  subject: 'Weekly Newsletter',
  htmlContent: '<h1>This week...</h1>',
  fromEmail: '[email protected]'
});

Schedule Email

await client.scheduleEmail({
  toEmail: '[email protected]',
  subject: 'Reminder: Meeting Tomorrow',
  htmlContent: '<p>Don\'t forget our meeting!</p>',
  fromEmail: '[email protected]',
  scheduledTime: new Date('2026-03-01T10:00:00Z')
});

Create Campaign

const campaign = await client.createCampaign({
  name: 'Product Launch',
  subject: 'Introducing Our New Product',
  fromEmail: '[email protected]',
  htmlContent: '<h1>Big News!</h1>',
  recipients: ['[email protected]', '[email protected]']
});

await client.sendCampaign(campaign.data.id);

Manage Templates

const template = await client.createTemplate({
  name: 'Welcome Email',
  subject: 'Welcome to {{company}}',
  htmlContent: '<h1>Hello {{name}}</h1>',
  category: 'welcome',
  variables: ['name', 'company']
});

const templates = await client.getTemplates();
await client.updateTemplate(template.data.id, { subject: 'Welcome {{name}}!' });
await client.deleteTemplate(template.data.id);

Webhooks

await client.createWebhook({
  name: 'Email Events',
  url: 'https://yourdomain.com/webhooks/email',
  events: ['email.sent', 'email.opened', 'email.clicked', 'email.bounced']
});

Analytics

const stats = await client.getEmailStats();
const analytics = await client.getAnalytics('campaign-id');

Error Handling

try {
  await client.sendEmail({ /* ... */ });
} catch (error) {
  if (error.message.includes('Unauthorized')) {
    console.error('Invalid API key');
  } else if (error.message.includes('Rate limited')) {
    console.error('Too many requests, wait before retrying');
  } else {
    console.error('Error:', error.message);
  }
}

TypeScript Support

import SendCraft, { SendEmailParams, SendCraftResponse } from 'sendcraft-sdk';

const client = new SendCraft({ apiKey: process.env.SENDCRAFT_API_KEY! });

const params: SendEmailParams = {
  toEmail: '[email protected]',
  subject: 'Hello',
  htmlContent: '<p>Test</p>'
};

const result: SendCraftResponse = await client.sendEmail(params);

Environment Variables

SENDCRAFT_API_KEY=sk_live_your_key_here
const SendCraft = require('sendcraft-sdk');

const client = new SendCraft({
  apiKey: process.env.SENDCRAFT_API_KEY
});

API Reference

| Method | Description | |--------|-------------| | sendEmail(params) | Send a single email | | sendBulkEmails(params) | Send emails to multiple recipients | | scheduleEmail(params) | Schedule email for future delivery | | getEmailStats() | Get email statistics | | createCampaign(params) | Create email campaign | | getCampaigns(limit) | Get all campaigns | | getCampaign(id) | Get campaign by ID | | sendCampaign(id) | Send campaign | | createTemplate(params) | Create email template | | getTemplates() | Get all templates | | getTemplate(id) | Get template by ID | | updateTemplate(id, params) | Update template | | deleteTemplate(id) | Delete template | | addSubscriber(params) | Add subscriber to list | | getSubscribers(listId, limit) | Get subscribers | | removeSubscriber(id) | Remove subscriber | | createWebhook(params) | Create webhook | | getWebhooks() | Get all webhooks | | deleteWebhook(id) | Delete webhook | | getAnalytics(campaignId) | Get campaign analytics | | getBillingInfo() | Get billing information | | getAccount() | Get account details | | updateAccount(params) | Update account | | changePassword(old, new) | Change password |

Support

License

MIT