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

arca-react

v0.1.1

Published

Arca Protocol React SDK for building high-performance subscription interfaces.

Readme

arca-react

The professional, high-fidelity React SDK for the Arca Protocol. Build stunning, production-ready subscription interfaces with custom-tailored styling, real-time blockchain synchronization, and zero third-party animation overhead.

🚀 Features

  • Provider Pattern: Centralized API key management with ArcaProvider.
  • Live Hooks: Real-time membership tracking with useArca.
  • Perk-Gated Interfaces: Resolve bought tier names, active features, and local expiration dates with useArcaPerks.
  • Smart Transitions: Automatic Contextual upgrade/downgrade button states based on prices (no rigid plan lockouts).
  • Double-Subscription Block: Blocks double-purchases of the same tier at the UI level.
  • Extreme Customizability: Inject custom button labels, style custom classes (classNames), and replace rendering completely using custom slot renderers (renderHeader, renderFooter, renderTierButton).
  • Performance First: Zero dependencies on heavy libraries like framer-motion. Built entirely using native, high-performance CSS hardware transitions.

📦 Installation

npm install arca-react

🛠️ Quick Start

1. Wrap your Application

import { ArcaProvider } from 'arca-react';

function App() {
  return (
    <ArcaProvider apiKey="arca_your_api_key_here">
      <MyRoutes />
    </ArcaProvider>
  );
}

2. Add the Pricing Table

import { ArcaPricingTable } from 'arca-react';

function PricingPage() {
  return (
    <ArcaPricingTable 
      planId="0x..." 
      userId="user_123" 
      appearance={{
        theme: "dark",
        variables: {
          colorPrimary: "#00FFC2",
          borderRadius: "24px"
        }
      }}
    />
  );
}

🛡️ Hooks & Feature Gating

useArca (Active Status & Countdown)

The primary hook to inspect the overall membership status, remaining time, and list of all active/bought tier IDs.

import { useArca } from 'arca-react';

function PremiumFeature() {
  const { status, remainingSeconds, tierIds, loading } = useArca(PLAN_ID, USER_ID);

  if (loading) return <div>Syncing status...</div>;
  if (status !== 'ACTIVE') return <div>Access Denied</div>;

  return (
    <div>
      <p>Premium Content Unlocked!</p>
      <p>Access ends in {Math.floor(remainingSeconds / 3600)} hours.</p>
    </div>
  );
}

createArcaClient (Subscription Check)

Create a client with your API key, then fetch a user's subscription status for a plan.

import { createArcaClient } from 'arca-react';

const arca = createArcaClient('arca_your_api_key_here');

async function checkSubscription(planId: string, userId: string) {
  const subscription = await arca.getSubscriptionStatus(planId, userId);
  if (!subscription) return 'NONE';
  return subscription.status;
}

useArcaPerks (Subscribed Perks & Features)

Fetches active plan details, listing subscribed tiers, their respective features, and custom expiration dates.

import { useArcaPerks } from 'arca-react';

function ActiveUserPerks() {
  const { perks, loading } = useArcaPerks(PLAN_ID, USER_ID);

  if (loading) return <div>Syncing perks...</div>;
  if (!perks) return <div>No active plans or perks.</div>;

  return (
    <div>
      <h3>Your Active Subscriptions & Perks</h3>
      {perks.map((subbedTier) => (
        <div key={subbedTier.tierId} style={{ marginTop: '16px' }}>
          <h4>{subbedTier.tierName} (Expires: {subbedTier.expiryDate.toLocaleDateString()})</h4>
          <ul>
            {subbedTier.features.map((feat, idx) => (
              <li key={idx}>
                <strong>{feat.title}</strong>: {feat.description}
              </li>
            ))}
          </ul>
        </div>
      ))}
    </div>
  );
}

✅ Server-Side Subscription Check

Create a client instance once and reuse it to check a user's subscription for a plan.

import { createArcaClient } from 'arca-react';

const arca = createArcaClient("arca_your_api_key_here");

const status = await arca.getSubscriptionStatus("0x...", "user_123");
// status = { status, remainingSeconds, tierId, tierIds }

🎨 Advanced Customization

1. Custom Labels (customLabels)

Override the default CTA texts easily:

<ArcaPricingTable 
  planId="0x..." 
  userId="user_123"
  customLabels={{
    activeSubscription: "Current active tier",
    upgrade: "Level Up",
    downgrade: "Downgrade Plan",
    getTier: "Join {{tierLabel}}"
  }}
/>

2. Style Custom Class Overrides (classNames)

Map your own tailwind classes or custom stylesheets to specific components inside the pricing table:

<ArcaPricingTable 
  planId="0x..." 
  userId="user_123"
  classNames={{
    card: "border-2 border-slate-700 bg-slate-900 rounded-3xl",
    button: "bg-emerald-500 text-slate-950 font-bold hover:scale-105"
  }}
/>

3. Slot Renderers (renderHeader, renderFooter, renderTierButton)

Replace specific sections of the layout completely while preserving internal loading states and purchase arcanics.

<ArcaPricingTable 
  planId="0x..." 
  userId="user_123"
  renderTierButton={(tier, state, handleSelect) => (
    <button 
      onClick={handleSelect}
      disabled={state.isDisabled}
      className={`btn-${state.isUpgrade ? 'upgrade' : 'purchase'}`}
    >
      {state.label}
    </button>
  )}
/>

📄 License

MIT © Arca Pay