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

@artamail/sdk

v0.1.1

Published

Official ArtaMail SDK for sending transactional and marketing emails

Readme

@artamail/sdk

Official ArtaMail SDK for Node.js and browsers. Send transactional and marketing emails with ease.

Installation

pnpm add @artamail/sdk
# or
npm install @artamail/sdk

Quick Start

import { ArtaMail } from '@artamail/sdk';

const artamail = new ArtaMail({
  apiKey: 'am_live_sk_xxx' // Get your API key from the dashboard
});

// Send a transactional email
const result = await artamail.send({
  to: '[email protected]',
  template: 'welcome',
  data: {
    name: 'John',
    verifyUrl: 'https://example.com/verify?token=xxx'
  }
});

console.log('Email queued:', result.id);

API Reference

Configuration

const artamail = new ArtaMail({
  apiKey: 'am_live_sk_xxx',  // Required
  baseUrl: 'https://mail.artamail.com', // Optional
  timeout: 30000,  // Request timeout in ms (default: 30000)
  retries: 3,      // Retry attempts (default: 3)
});

Sending Emails

Single Email

const result = await artamail.send({
  to: '[email protected]',
  template: 'welcome',
  data: { name: 'John' },

  // Optional
  from: '[email protected]',
  fromName: 'Your Company',
  replyTo: '[email protected]',
  priority: 'high', // 'high' | 'normal' | 'low'
  addToContacts: true,
  metadata: { userId: '123' }
});

Batch Emails

const result = await artamail.sendBatch({
  emails: [
    { to: '[email protected]', template: 'notification', data: { ... } },
    { to: '[email protected]', template: 'notification', data: { ... } },
  ],
  addToContacts: false
});

console.log(`Queued: ${result.queued}, Failed: ${result.failed}`);

Get Email Status

const email = await artamail.getEmail('email-id');
console.log(email.status); // 'queued' | 'sent' | 'delivered' | 'bounced' | ...

Contacts

// Create or update a contact
const contact = await artamail.upsertContact({
  email: '[email protected]',
  name: 'John Doe',
  data: { company: 'Acme Inc', role: 'Developer' },
  lists: ['newsletter', 'product-updates']
});

// Get a contact
const contact = await artamail.getContact('[email protected]');

// Update a contact
await artamail.updateContact('[email protected]', {
  name: 'Jane Doe',
  subscribed: false
});

// Delete a contact
await artamail.deleteContact('[email protected]');

Templates

// List all templates
const templates = await artamail.listTemplates();

// Get template details
const template = await artamail.getTemplate('welcome');
console.log(template.variables); // ['name', 'verifyUrl']

Error Handling

import {
  ArtaMailError,
  ValidationError,
  AuthenticationError,
  RateLimitError
} from '@artamail/sdk';

try {
  await artamail.send({ ... });
} catch (error) {
  if (error instanceof ValidationError) {
    console.error('Invalid input:', error.message);
  } else if (error instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof RateLimitError) {
    console.error('Rate limited, retry after:', error.retryAfter);
  } else if (error instanceof ArtaMailError) {
    console.error('API error:', error.code, error.message);
  }
}

TypeScript

This package is written in TypeScript and includes full type definitions.

import type {
  SendEmailOptions,
  SendEmailResult,
  Contact,
  Template
} from '@artamail/sdk';

Framework Integrations

  • Next.js: Use @artamail/nextjs for server-side helpers
  • Nuxt: Use @artamail/nuxt for Nuxt 3 plugin

License

MIT