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

refkit-sdk

v1.0.1

Published

Web3 Loyalty, Rewards, and Referral SDK for React & JS

Readme

RefKit SDK

RefKit SDK is the business-side ingestion client for referral and event tracking.

It is aligned to the current API contract:

  • POST /track
  • POST /sdk/referrals/apply
  • GET /sdk/referrals

The SDK sends API-key authenticated requests and supports idempotent tracking payloads.

Install

npm install refkit-sdk

Quick Start (NPM)

import { RefKitClient } from "@repo/sdk";

const refkit = new RefKitClient({
  apiKey: "rk_live_xxx",
  apiUrl: "https://your-api-host",
  source: "my-app",
});

// Track a generic event
await refkit.trackEvent({
  eventName: "signup_complete",
  metadata: { plan: "starter" },
});

// Track a referral event
await refkit.trackReferralConversion({
  referrer: "alice-code",
  metadata: {
    referredUserEmail: "[email protected]",
  },
});

// Apply referral directly
await refkit.applyReferral({
  referralCode: "alice-code",
  referredUserEmail: "[email protected]",
});

// Read recent referrals linked to this API key
const recent = await refkit.listReferrals(25);

Request Behavior

The API can process synchronously or queue to worker depending on payload context.

Typical response envelope:

{
  "success": true,
  "queued": true,
  "jobId": "event:...",
  "jobType": "EVENT_PROCESS"
}

Or synchronous:

{
  "success": true,
  "processedSynchronously": true,
  "queued": false,
  "triggerId": "..."
}

React Package

The package also exports lightweight React helpers:

  • RefKitProvider
  • useTrackEvent
  • useApplyReferral
  • useRecentReferrals
  • Leaderboard
  • UserRewardsDashboard

Example:

import { RefKitProvider, useTrackEvent } from "@repo/sdk/react";

function TrackButton() {
  const { track, isLoading } = useTrackEvent();

  return (
    <button
      disabled={isLoading}
      onClick={() =>
        track({ eventName: "button_click", metadata: { section: "hero" } })
      }
    >
      Track
    </button>
  );
}

export function App() {
  return (
    <RefKitProvider
      config={{ apiKey: "rk_live_xxx", apiUrl: "https://your-api-host" }}
    >
      <TrackButton />
    </RefKitProvider>
  );
}

CDN Build

The SDK builds a browser bundle at dist/cdn/refkit.min.js. Build script also copies it to:

  • apps/api/public/cdn/refkit.min.js
  • apps/web/public/refkit.min.js
npm run build --workspace packages/sdk

Notes

  • Keep API keys server-safe whenever possible.
  • If used client-side, restrict origins in Business API Key settings.
  • Use idempotency keys for repeated or retried event submissions.