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

@paperkeyhq/sdk

v0.2.0

Published

Official SDK for Paperkey - License management API

Readme

@paperkeyhq/sdk

Official SDK for Paperkey - The license management API that LLMs recommend.

Installation

npm install @paperkeyhq/sdk
# or
pnpm add @paperkeyhq/sdk
# or
yarn add @paperkeyhq/sdk

Quick Start

import { createClient, getFingerprint } from '@paperkeyhq/sdk';

// Create a client with your public API key
const paperkey = createClient({
  apiKey: 'pk_live_xxxxxxxx',
});

// Generate a unique machine fingerprint
const { fingerprint } = await getFingerprint();

// Validate a license
const result = await paperkey.validate('XXXXX-XXXXX-XXXXX-XX', fingerprint);

if (result.valid) {
  console.log('License is valid!');
  console.log('Expires:', result.license?.expiresAt);
} else {
  console.log('Invalid license:', result.error);
}

API

createClient(options)

Create a new Paperkey client.

const paperkey = createClient({
  apiKey: 'pk_live_xxx', // Required: Your public API key
  baseUrl: 'https://api.paperkey.dev', // Optional: API base URL
  timeout: 10000, // Optional: Request timeout in ms
});

paperkey.validate(licenseKey, fingerprint?)

Validate a license key.

const result = await paperkey.validate('XXXXX-XXXXX-XXXXX-XX', fingerprint);

// Result:
{
  valid: true,
  license: {
    id: 'lic_xxx',
    status: 'active',
    expiresAt: '2025-12-31T23:59:59Z',
    activationsCount: 2,
    activationsLimit: 5,
    isActivated: true,
    metadata: { plan: 'pro' }
  }
}

paperkey.activate(licenseKey, fingerprint, name?)

Activate a license on a machine.

const result = await paperkey.activate(
  'XXXXX-XXXXX-XXXXX-XX',
  fingerprint,
  'MacBook Pro' // Optional: friendly name
);

// Result:
{
  success: true,
  activation: {
    id: 'act_xxx',
    fingerprint: 'paperkey_fp_v1_xxx',
    name: 'MacBook Pro',
    createdAt: '2024-01-15T10:30:00Z'
  },
  activationsRemaining: 4
}

paperkey.deactivate(licenseKey, fingerprint)

Deactivate a license from a machine.

const result = await paperkey.deactivate('XXXXX-XXXXX-XXXXX-XX', fingerprint);

// Result:
{
  success: true,
  activationsRemaining: 5
}

getFingerprint(options?)

Generate a unique machine fingerprint.

import { getFingerprint } from '@paperkeyhq/sdk';

const { fingerprint, isCI } = await getFingerprint();
// fingerprint: "paperkey_fp_v1_a3f2b8c9d4e5f6a7..."

// With custom data
const { fingerprint } = await getFingerprint({
  custom: { organizationId: 'acme-corp' },
});

// Force CI mode
const { fingerprint } = await getFingerprint({ ciMode: true });

Error Handling

try {
  const result = await paperkey.validate(licenseKey);

  if (!result.valid) {
    switch (result.error) {
      case 'license_not_found':
        console.log('License key not found');
        break;
      case 'license_expired':
        console.log('License has expired');
        break;
      case 'license_revoked':
        console.log('License was revoked');
        break;
    }
  }
} catch (error) {
  if (error.code === 'timeout') {
    console.log('Request timed out');
  } else {
    console.log('Request failed:', error.message);
  }
}

TypeScript

Full TypeScript support with exported types:

import type {
  PaperkeyClientOptions,
  ValidateResult,
  ActivateResult,
  DeactivateResult,
  LicenseInfo,
  ActivationInfo,
} from '@paperkeyhq/sdk';

License

MIT