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

@pulsesend/sdks

v0.1.0

Published

Official JavaScript/TypeScript SDK for PulseSend API

Readme

@pulsesend/javascript

Official JavaScript/TypeScript SDK for the PulseSend API.

Installation

npm install @pulsesend/javascript
# or
yarn add @pulsesend/javascript
# or
bun add @pulsesend/javascript

Quick Start

import { PulseSend } from '@pulsesend/javascript'

const client = new PulseSend('pk_live_your_api_key_here')

// Send an email
await client.emails.send({
  to: ['[email protected]'],
  from: '[email protected]',
  subject: 'Welcome {{name}}!',
  html: '<h1>Hello {{name}}!</h1><p>Welcome to our platform.</p>',
  variables: {
    name: 'John Doe'
  }
})

Configuration

Basic Configuration

const client = new PulseSend('pk_live_your_api_key_here')

Advanced Configuration

const client = new PulseSend({
  apiKey: 'pk_live_your_api_key_here',
  baseUrl: 'https://api.pulsesend.com/v1', // Optional
  timeout: 10000, // Optional, default: 10s
  retries: 3, // Optional, default: 3
  retryDelay: 1000 // Optional, default: 1s
})

API Reference

Emails

Send Email

const result = await client.emails.send({
  to: ['[email protected]'],
  from: '[email protected]',
  subject: 'Your Subject',
  html: '<p>Your HTML content</p>',
  // Optional fields
  text: 'Your plain text content',
  cc: ['[email protected]'],
  bcc: ['[email protected]'],
  variables: { name: 'John' },
  tags: ['marketing'],
  metadata: { campaign: 'welcome' },
  sendAt: new Date('2024-01-01T10:00:00Z')
})

List Emails

const emails = await client.emails.list({
  status: 'delivered',
  limit: 50,
  offset: 0,
  startDate: new Date('2024-01-01'),
  endDate: new Date('2024-01-31')
})

Get Email

const email = await client.emails.get('email_id')

Cancel Email

await client.emails.cancel('email_id')

Analytics

Overview

const analytics = await client.analytics.overview({
  startDate: new Date('2024-01-01'),
  endDate: new Date('2024-01-31'),
  tags: ['marketing']
})

Engagement

const engagement = await client.analytics.engagement()

Reputation

const reputation = await client.analytics.reputation()

Error Handling

The SDK provides specific error classes for different scenarios:

import { 
  InvalidApiKeyError,
  QuotaExceededError,
  RateLimitError,
  ValidationError,
  NetworkError,
  TimeoutError,
  ServerError
} from '@pulsesend/javascript'

try {
  await client.emails.send(emailData)
} catch (error) {
  if (error instanceof QuotaExceededError) {
    console.log('Quota exceeded, upgrade your plan')
  } else if (error instanceof RateLimitError) {
    console.log(`Rate limited, retry after ${error.retryAfter} seconds`)
  } else if (error instanceof ValidationError) {
    console.log('Validation error:', error.details)
  }
}

TypeScript Support

The SDK is written in TypeScript and provides full type definitions:

import { SendEmailRequest, SendEmailResponse } from '@pulsesend/javascript'

const request: SendEmailRequest = {
  to: ['[email protected]'],
  from: '[email protected]',
  subject: 'Test',
  html: '<p>Test</p>'
}

const response: SendEmailResponse = await client.emails.send(request)

Retry Logic

The SDK automatically retries failed requests with exponential backoff for:

  • Network errors
  • Timeout errors
  • Server errors (5xx)
  • Rate limiting (with proper delay)

Environment Variables

You can set your API key using environment variables:

export PULSESEND_API_KEY=pk_live_your_api_key_here
const client = new PulseSend(process.env.PULSESEND_API_KEY!)

Examples

See the examples directory for more usage examples.

License

MIT © PulseSend