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

@ircg/sdk

v1.20.9

Published

Complete SDK for IRCG services - includes TES, IOS, and USS clients

Downloads

5

Readme

@ircg/sdk

Complete SDK for all IRCG services. This package includes clients for:

  • TES (Transactional Email Service)
  • IOS (Image Optimization Service)
  • USS (URL Shortener Service)

Installation

pnpm add @ircg/sdk

This single package includes everything you need to use all IRCG services.

Usage

Import all clients

import { TESClient, IOSClient, USSClient } from '@ircg/sdk';

const apiKey = 'your-api-key';

// Initialize clients
const tes = new TESClient({ apiKey });
const ios = new IOSClient({ apiKey });
const uss = new USSClient({ apiKey });

// Use them
await tes.sendText('[email protected]', '[email protected]', 'Hello', 'Message');
const image = await ios.upload({ image: file });
const url = await uss.create({ url: 'https://example.com' });

Import only what you need

// Only email client
import { TESClient } from '@ircg/sdk';

// Only types
import type { SendEmailRequest, OptimizedImageComplete } from '@ircg/sdk';

// Errors
import { IRCGError, IRCGAuthenticationError } from '@ircg/sdk';

What's Included

Clients

  • TESClient - Transactional Email Service
  • IOSClient - Image Optimization Service
  • USSClient - URL Shortener Service

Types

All TypeScript types from all services are re-exported.

Errors

  • IRCGError - Base error class
  • IRCGAuthenticationError - Authentication failures
  • IRCGValidationError - Validation errors
  • IRCGRateLimitError - Rate limit exceeded
  • IRCGServerError - Server errors

Examples

Send an email

import { TESClient } from '@ircg/sdk';

const tes = new TESClient({ apiKey: 'your-key' });

await tes.sendHtml(
  '[email protected]',
  '[email protected]',
  'Welcome!',
  '<h1>Welcome to our service!</h1>'
);

Optimize an image

import { IOSClient } from '@ircg/sdk';

const ios = new IOSClient({ apiKey: 'your-key' });

const result = await ios.upload({
  image: file,
  requireSignedURLs: false
}, 'complete');

console.log(result.optimizedImage.currentVariants);

Shorten a URL

import { USSClient } from '@ircg/sdk';

const uss = new USSClient({ apiKey: 'your-key' });

const result = await uss.create({
  url: 'https://example.com/very/long/url'
});

console.log(`Short URL: https://ircg.dev/l/${result.shortenedUrl.urlKey}`);

Use all services together

import { TESClient, IOSClient, USSClient } from '@ircg/sdk';

const apiKey = 'your-api-key';

const tes = new TESClient({ apiKey });
const ios = new IOSClient({ apiKey });
const uss = new USSClient({ apiKey });

// Upload image
const imageResult = await ios.upload({ image: file });

// Shorten URL
const urlResult = await uss.create({ url: 'https://example.com' });

// Send email with both
await tes.sendHtml(
  '[email protected]',
  '[email protected]',
  'Check this out!',
  `
    <img src="${ios.getImageUrl(imageResult.optimizedImage.imageId, 'thumbnail')}">
    <a href="https://ircg.dev/l/${urlResult.shortenedUrl.urlKey}">Click here</a>
  `
);

Error Handling

import { 
  TESClient, 
  IRCGError, 
  IRCGAuthenticationError,
  IRCGValidationError 
} from '@ircg/sdk';

const tes = new TESClient({ apiKey: 'your-key' });

try {
  await tes.sendText('invalid-email', '[email protected]', 'Test', 'Message');
} catch (error) {
  if (error instanceof IRCGAuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof IRCGValidationError) {
    console.error('Validation error:', error.details);
  } else if (error instanceof IRCGError) {
    console.error('IRCG error:', error.message);
  }
}

Individual Packages

If you only need one service, you can install individual packages:

pnpm add @ircg/tes  # Only email service
pnpm add @ircg/ios  # Only image optimization
pnpm add @ircg/uss  # Only URL shortener

Documentation

TypeScript

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

import type { 
  SendEmailRequest,
  OptimizedImageComplete,
  ShortenedUrlMinimal 
} from '@ircg/sdk';

const emailData: SendEmailRequest = {
  sender: '[email protected]',
  recipients: ['[email protected]'],
  subject: 'Hello',
  html: '<p>Message</p>'
};

License

MIT