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

@quantabit/social-sdk

v1.0.2

Published

QuantaBit Social Interaction SDK - Universal social components (like, comment, share, bookmark, follow, tip, etc.)

Readme

@quantabit/social-sdk

Universal social interaction SDK providing full social feature support for the DID ecosystem.

✨ Features

  • 🎯 Like System - Quick like/unlike with real-time counting
  • Bookmark Feature - Save interesting content
  • 👥 Follow System - Follow users or projects
  • 📍 Progress Tracking - Track project progress
  • 💬 Comment System - Nested replies, likes, edit, and delete
  • 🔗 Share Feature - One-click sharing to multiple platforms (Twitter, Facebook, WeChat, etc.)
  • 💡 Suggestions - Submit, vote, and accept suggestions
  • 🎁 Tip System - Multi-currency support (XWIN, USDT, BTC, ETH, and 10+ currencies)
  • 🔔 Reminder Settings - Email, push, and SMS multi-channel reminders
  • 🌍 Multi-Language Support - Chinese, English, Japanese, Korean

📦 Installation

npm install @quantabit/social-sdk
# or
yarn add @quantabit/social-sdk
# or
pnpm add @quantabit/social-sdk

🚀 Quick Start

1. Import Styles

/* In your global CSS file */
@import "@quantabit/social-sdk/dist/styles.css";

Or in JavaScript:

import "@quantabit/social-sdk/styles";

2. Configure Provider

import { SocialProvider } from "@quantabit/social-sdk";

function App() {
  return (
    <SocialProvider
      apiBaseUrl="/api/v1/interactions"
      getToken={() => localStorage.getItem("access_token")}
      language="en"
      onAuthRequired={() => {
        // Navigate to login page
        window.location.href = "/login";
      }}
    >
      <YourApp />
    </SocialProvider>
  );
}

3. Using Components

import {
  LikeButton,
  FavoriteButton,
  CommentSection,
  InteractionBar,
  TipButton,
  ShareButton,
} from "@quantabit/social-sdk";

function ProjectDetail({ project }) {
  return (
    <div>
      <h1>{project.title}</h1>

      {/* Interaction bar */}
      <InteractionBar targetType="project" targetId={project.id} />

      {/* Or use individual buttons */}
      <div className="actions">
        <LikeButton targetType="project" targetId={project.id} />
        <FavoriteButton targetType="project" targetId={project.id} />
        <ShareButton
          targetType="project"
          targetId={project.id}
          title={project.title}
        />
        <TipButton
          targetType="project"
          targetId={project.id}
          receiverId={project.creatorId}
          receiverName={project.creatorName}
        />
      </div>

      {/* Comment section */}
      <CommentSection targetType="project" targetId={project.id} />
    </div>
  );
}

📖 API Reference

Provider

<SocialProvider>

| Prop | Type | Required | Description | | -------------- | --------------- | -------- | -------------------------------------------- | | apiBaseUrl | string | No | API base URL, default /api/v1/interactions | | getToken | () => string | No | Token getter function | | language | string | No | Language code: en, zh, ja, ko | | userId | string | No | Current user ID | | onAuthRequired | () => void | No | Auth required callback | | onError | (error) => void | No | Error handling callback |

Components

Interaction Buttons

| Component | Description | | ------------------ | --------------- | | <LikeButton> | Like button | | <FavoriteButton> | Bookmark button | | <FollowButton> | Follow button | | <TrackButton> | Track button | | <ShareButton> | Share button | | <TipButton> | Tip button | | <ReminderButton> | Reminder button |

Common props:

| Prop | Type | Description | | ---------- | ------------------------- | -------------------------------------------- | | targetType | string | Target type: project, user, post, etc. | | targetId | string | Target ID | | size | string | Size: small, medium, large | | showCount | boolean | Whether to show count | | className | string | Custom class name | | onToggle | (isActive, count) => void | Toggle state callback |

Interaction Bar

<InteractionBar
  targetType="project"
  targetId="123"
  showLike={true}
  showFavorite={true}
  showComment={true}
  showShare={true}
  showTip={true}
  onCommentClick={() => {}}
  onShareClick={() => {}}
  onTipClick={() => {}}
/>

Comment Component

<CommentSection
  targetType="project"
  targetId="123"
  pageSize={20}
  onCommentCreated={() => {}}
/>

Suggestion Component

<SuggestionSection targetType="project" targetId="123" canAccept={isOwner} />

Tip Component

<TipModal
  isOpen={showTipModal}
  onClose={() => setShowTipModal(false)}
  targetType="project"
  targetId="123"
  receiverId={creatorId}
  receiverName={creatorName}
  onSuccess={(tip) => console.log('Tip sent!', tip)}
/>

<TipList targetType="project" targetId="123" />
<TipRanking targetType="project" targetId="123" />

Hooks

useInteraction

const {
  isLiked,
  isFavorited,
  isFollowing,
  isTracking,
  loading,
  toggleLike,
  toggleFavorite,
  toggleFollow,
  toggleTrack,
} = useInteraction("project", projectId);

useComments

const {
  comments,
  total,
  hasMore,
  loading,
  createComment,
  updateComment,
  deleteComment,
  likeComment,
  loadMore,
} = useComments("project", projectId);

useTips

const { tips, ranking, currencies, sendTip, confirmTip } = useTips(
  "project",
  projectId,
);

useShare

const { shareUrl, qrCodeUrl, copied, shareTo, copyLink, nativeShare } =
  useShare("project", projectId, { title, description });

useSuggestions

const { suggestions, createSuggestion, vote, accept } = useSuggestions(
  "project",
  projectId,
);

useStats

const {
  likeCount,
  favoriteCount,
  commentCount,
  shareCount,
  viewCount,
  tipTotalUsd,
} = useStats("project", projectId);

🎨 Theme Customization

The SDK uses CSS variables for easy theme customization:

:root {
  /* Primary color */
  --social-primary: #6366f1;
  --social-primary-hover: #4f46e5;

  /* Interaction colors */
  --social-like: #ef4444;
  --social-favorite: #f59e0b;
  --social-follow: #10b981;
  --social-tip: #8b5cf6;

  /* Background colors */
  --social-bg: #ffffff;
  --social-bg-secondary: #f8fafc;

  /* Text colors */
  --social-text: #1e293b;
  --social-text-secondary: #64748b;

  /* Border radius */
  --social-radius: 8px;
  --social-radius-full: 9999px;
}

Dark Mode

Add data-theme="dark" or .dark class to the root element to enable dark mode.

🌍 Internationalization

import { setLanguage, t } from "@quantabit/social-sdk";

// Set language
setLanguage("en");

// Get translation
const text = t("like"); // "Like"

Supported languages:

  • en - English
  • zh - Chinese
  • ja - Japanese
  • ko - Korean

💰 Supported Currencies

The tip system supports the following currencies:

| Currency | Name | Type | | -------- | ------------- | -------------- | | XWIN | XWIN Token | Platform Token | | QBT | QBit Token | Platform Token | | USDT | Tether USD | Stablecoin | | USD | US Dollar | Fiat | | BTC | Bitcoin | Cryptocurrency | | ETH | Ethereum | Cryptocurrency | | SOL | Solana | Cryptocurrency | | MATIC | Polygon | Cryptocurrency | | BNB | BNB | Cryptocurrency | | AVAX | Avalanche | Cryptocurrency |

📝 Backend API

The SDK requires the following backend API endpoints:

  • POST /interactions/toggle - Toggle interaction status
  • GET /interactions/status/{type}/{id} - Get user interaction status
  • GET /interactions/stats/{type}/{id} - Get statistics data
  • POST /interactions/comments - Create comment
  • GET /interactions/comments/{type}/{id} - Get comment list
  • POST /interactions/shares - Create share
  • POST /interactions/suggestions - Create suggestion
  • GET /interactions/tips/currencies - Get supported currencies
  • POST /interactions/tips - Create tip
  • POST /interactions/reminders - Create reminder

For detailed API specifications, please refer to the backend documentation.

📄 License

MIT License

🤝 Contributing

Welcome to submit Issues and Pull Requests!


🌐 Brand & Links