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

@virex-tech/paywallo-sdk

v2.2.6

Published

SDK React Native para integração com Paywallo - Paywalls, Subscriptions e Analytics

Readme

@virex-tech/paywallo-sdk

Paywalls, subscriptions, analytics and feature flags for React Native.

Install

npm install @virex-tech/paywallo-sdk

iOS:

cd ios && pod install

That's it. The SDK includes its own native modules for storage, device info and StoreKit — no extra dependencies needed.

Optional: Ad tracking (IDFA)

If your app uses Facebook Ads, AppsFlyer or any attribution that needs the Apple IDFA, install the tracking transparency module:

npm install expo-tracking-transparency

This enables the ATT prompt ("Allow this app to track your activity?"). Without it, the SDK skips IDFA collection — everything else works normally.

Quick start

1. Wrap your app

import { PaywalloProvider } from '@virex-tech/paywallo-sdk';

export default function App() {
  return (
    <PaywalloProvider
      config={{
        appKey: 'your_app_key',
        debug: __DEV__,
      }}
    >
      <YourApp />
    </PaywalloProvider>
  );
}

2. Gate content with a paywall

import { PaywalloClient } from '@virex-tech/paywallo-sdk';

const hasAccess = await PaywalloClient.requireSubscriptionWithCampaign('my-campaign');
if (hasAccess) {
  // User has an active subscription or just purchased
}

3. Check subscription status

const isActive = await PaywalloClient.hasActiveSubscription();

Hooks

usePaywallo()

| Property | Type | Description | |---|---|---| | isInitialized | boolean | SDK ready | | isReady | boolean | SDK ready and products loaded | | distinctId | string | Current user ID | | presentCampaign(placement) | Promise<CampaignResult> | Show a campaign paywall | | hasActiveSubscription() | Promise<boolean> | Check subscription status | | getSubscription() | Promise<Subscription> | Get subscription data | | restorePurchases() | Promise<RestoreResult> | Restore previous purchases |

useSubscription()

| Property | Type | Description | |---|---|---| | subscription | Subscription \| null | Current subscription | | hasActiveSubscription | boolean | Whether subscription is active | | isLoading | boolean | Loading state | | refresh() | () => void | Refetch subscription data |

usePurchase()

| Property | Type | Description | |---|---|---| | purchase(productId) | Promise<PurchaseOutcome> | Purchase a product | | restore() | Promise<IAPPurchase[]> | Restore purchases | | isPurchasing | boolean | Purchase in progress | | isRestoring | boolean | Restore in progress | | error | PurchaseError \| null | Last error |

Plans & Offerings

An offering is a group of products configured in the dashboard that you display together on a paywall. You can swap the active offering in the dashboard without shipping a new app version.

useOfferings()

import { useOfferings, useOfferingPurchase } from "@virex-tech/paywallo-sdk";

// Fetch specific offerings by identifier
const { offerings } = useOfferings(["mensal", "anual", "lifetime"]);

// Fetch all offerings
const { offerings } = useOfferings();

// Purchase
const { purchase } = useOfferingPurchase();
purchase(offering.product.productId);

| Property | Type | Description | |---|---|---| | offerings | Offering[] | List of offerings | | isLoading | boolean | Loading state |

useOfferingPurchase()

| Property | Type | Description | |---|---|---| | purchase(productId) | Promise<PurchaseOutcome> | Purchase a product from the offering | | isPurchasing | boolean | Purchase in progress |

Offering type

interface Offering {
  id: string;
  name: string;
  identifier: string;
  isCurrent: boolean;
  product: OfferingProduct;
}

interface OfferingProduct {
  id: string;
  name: string;
  productId: string;           // App Store / Play Store identifier
  priceUsd: number;
  billingPeriod: string;       // "monthly" | "annual" | "lifetime" | ...
  trialDays: number | null;

  // Intro offer (synced automatically from Apple/Google)
  introOfferMode: "FREE_TRIAL" | "PAY_AS_YOU_GO" | "PAY_UP_FRONT" | null;
  introOfferPrice: number | null;
  introOfferCurrency: string | null;
  introOfferCycles: number | null;
}

Example

import { useOfferings, useOfferingPurchase } from "@virex-tech/paywallo-sdk";

function Paywall() {
  const { offerings, isLoading } = useOfferings(["mensal", "anual"]);
  const { purchase, isPurchasing } = useOfferingPurchase();

  if (isLoading) return null;

  return offerings.map(offering => (
    <View key={offering.id}>
      <Text>{offering.product.name} — ${offering.product.priceUsd}</Text>

      {offering.product.introOfferMode === "FREE_TRIAL" && (
        <Text>{offering.product.trialDays}-day free trial</Text>
      )}
      {offering.product.introOfferMode === "PAY_AS_YOU_GO" && (
        <Text>
          {offering.product.introOfferCurrency} {offering.product.introOfferPrice}/period
          for {offering.product.introOfferCycles} cycles
        </Text>
      )}

      <Button
        onPress={() => purchase(offering.product.productId)}
        disabled={isPurchasing}
      >
        Subscribe
      </Button>
    </View>
  ));
}

Intro offers are synced automatically from App Store Connect and Google Play — no manual setup needed.


Imperative API

For use outside React components:

import { PaywalloClient } from '@virex-tech/paywallo-sdk';

// Identify user
await PaywalloClient.identify({ email: '[email protected]' });

// Track events
await PaywalloClient.track('purchase_completed', { properties: { product: 'premium' } });

// Feature flags
const variant = await PaywalloClient.getVariant('new_feature');

// Subscription gate
const hasAccess = await PaywalloClient.requireSubscriptionWithCampaign('premium');

Config options

interface PaywalloConfig {
  appKey: string;        // Required — your app key from the dashboard
  apiUrl?: string;       // API URL (default: https://paywallo.com.br)
  debug?: boolean;       // Enable debug logs (default: false)
  autoStartSession?: boolean;  // Auto-start session on init (default: true)
  sessionFlags?: string[];     // Flags to resolve during session start
}

Types

interface Subscription {
  productId: string;
  status: 'active' | 'expired' | 'cancelled' | 'in_grace_period';
  expiresAt: Date | null;
  platform: 'ios' | 'android';
  autoRenewEnabled: boolean;
}

interface CampaignResult {
  presented: boolean;
  purchased: boolean;
  restored: boolean;
  cancelled: boolean;
  error?: Error;
  skippedReason?: 'subscriber';
}

interface PurchaseOutcome {
  status: 'success' | 'cancelled' | 'failed';
  purchase?: IAPPurchase;
  error?: PurchaseError;
}

License

MIT