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

@medalsocial/sdk

v0.1.2

Published

TypeScript client for Medal Social API (create leads, notes, cookie consents, event signups)

Readme

Medal Social SDK (TypeScript)

Simple, typed client for the Medal Social API. Supports authentication via Client ID/Secret (Basic) today and Bearer token. Provides convenience methods for common create actions.

Install

corepack enable
pnpm add @medalsocial/sdk

Quick start

import MedalSocialClient from '@medalsocial/sdk';

const client = new MedalSocialClient({
  auth: { kind: 'basic', clientId: process.env.MEDAL_CLIENT_ID!, clientSecret: process.env.MEDAL_CLIENT_SECRET! },
  // or: auth: { kind: 'bearer', token: process.env.MEDAL_API_TOKEN! },
  // optional: baseUrl: 'https://api.medalsocial.com',
});

// Create lead(s)
await client.createLead([
  {
    name: 'Alex Example',
    email: '[email protected]',
    company: '',
    source: 'website',
  },
]);

// Create a note
await client.createNote({
  name: 'Test Testnes',
  email: '[email protected]',
  company: 'Medal Social Test company',
  phone: '+47 12345678',
  content: 'Hei jeg skal gjerne sende to konteinere til USA.',
  metadata: { Budsjett: '$100,000' },
});

// Record cookie consent
await client.createCookieConsent({
  domain: 'example.com',
  consentStatus: 'partial',
  consentTimestamp: '2025-06-04T10:30:00Z',
  ipAddress: '88.151.164.19',
  userAgent: 'Mozilla/5.0',
  cookiePreferences: {
    necessary: {
      allowed: true,
      cookieRecords: [
        { cookie: 'session_id', duration: 'Session', description: 'Essential for user authentication and session management' },
      ],
    },
    analytics: { allowed: false },
    marketing: { allowed: true },
    functional: { allowed: true },
  },
});

// Create event signup
await client.createEventSignup({
  contact: {
    name: 'Test Testnes',
    email: '[email protected]',
    company: 'Medal Social Test company',
  },
  event: {
    externalId: 'eksadaasdasd',
    name: 'Product saus asd',
    description: 'Learn about our new product asd',
    time: '2025-06-15T14:00:00Z',
    location: 'Online',
    thumbnail: 'https://medalsocialdevstorage.blob.core.windows.net/images/d05bad9e-bc52-4f8e-8191-d6944d34055c.jpg',
  },
});

API

  • new MedalSocialClient(options)

    • auth (required):
      • { kind: 'basic', clientId: string, clientSecret: string }
      • { kind: 'bearer', token: string }
    • baseUrl (optional): string. Defaults to https://api.medalsocial.com.
    • timeoutMs (optional): number. Defaults to 30000.
    • userAgent (optional): string.
    • fetch (optional): custom fetch implementation to override transport.
  • createLead(items: { name, email, company?, source? }[]) -> { status, data, headers }

  • createNote(input) -> { status, data, headers }

  • createCookieConsent(input) -> { status, data, headers }

  • createEventSignup(input) -> { status, data, headers }

  • sendTransactionalEmail(input) -> { status, data, headers }

Responses throw on non-2xx with an error containing status and details (parsed body when available).

Runtime support

  • Node 20+ and modern browsers. The client uses fetch; in Node 20+ fetch is built-in. For older environments, provide a global fetch polyfill.

Docs

  • API Reference (TypeDoc): published automatically from the prod branch via GitHub Pages.
  • Local: pnpm docs then open docs/index.html.

Contributing

PRs welcome! Use pnpm. Useful scripts:

pnpm install
pnpm build
pnpm test
pnpm docs

License

MIT