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

traaaction

v1.3.0

Published

TypeScript/JavaScript SDK for Traaaction affiliate tracking and management

Downloads

24

Readme

traaaction

Official TypeScript/JavaScript SDK for Traaaction — the affiliate SaaS platform connecting startups and sellers.

Installation

npm install traaaction
# or
yarn add traaaction
# or
pnpm add traaaction

Quick Start

import { Traaaction } from 'traaaction'

const trac = new Traaaction({
  apiKey: process.env.TRAAACTION_API_KEY,  // trac_live_xxx
})

Tracking

Track affiliate events from your server. Use the public key (pk_xxx) or secret key.

// After a user signs up
await trac.track.lead({
  customerId: user.id,
  clickId: request.cookies.get('trac_click_id')?.value,
  eventName: 'sign_up',
  customerEmail: user.email,
})

// Manual sale (if not using Stripe webhooks)
await trac.track.sale({
  customerId: user.id,
  amount: 5900,  // €59 in cents
  currency: 'EUR',
})

Management API

All management methods require a secret key (trac_live_xxx).

Short Links

// List links
const { data: links, meta } = await trac.links.list({ page: 1, limit: 50 })

// Create a link
const { data: link } = await trac.links.create({
  destination: 'https://example.com/landing',
  missionId: 'mission_id_here',
})

// Update a link
await trac.links.update(link.id, { channel: 'email' })

// Delete a link
await trac.links.delete(link.id)

Missions

const { data: missions } = await trac.missions.list({ status: 'ACTIVE' })
const { data: mission } = await trac.missions.get('mission_id')

Sellers

const { data: sellers } = await trac.sellers.list({ status: 'APPROVED' })
const { data: seller } = await trac.sellers.get('seller_id')
// seller.balance includes { pending, due, paid_total }

Customers

const { data: customers } = await trac.customers.list()
// Lookup by your app's user ID
const { data: customer } = await trac.customers.get(user.id)

Commissions

const { data: commissions } = await trac.commissions.list({
  status: 'PROCEED',
  sellerId: 'seller_id',
})

Payouts

const { data: payouts } = await trac.payouts.list()

Analytics

const { data: stats } = await trac.analytics.retrieve({ interval: '30d' })
// stats.clicks, stats.leads, stats.sales, stats.revenue, stats.timeseries

Error Handling

import { Traaaction, TraaactionAPIError, TraaactionAuthError } from 'traaaction'

try {
  const { data } = await trac.links.get('invalid_id')
} catch (error) {
  if (error instanceof TraaactionAuthError) {
    console.error('Invalid API key')
  } else if (error instanceof TraaactionAPIError) {
    console.error(`API error ${error.statusCode}: ${error.code}`)
  }
}

Requirements

  • Node.js 18+ (uses native fetch)
  • Works in Edge Runtime (Vercel, Cloudflare Workers)

License

MIT