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

@fitcal/sdk-react-native

v1.1.0

Published

SDK para integração com Monety - Analytics, Feature Flags, Paywalls e In-App Purchases

Readme

@monety/sdk-react-native

SDK oficial para integração com Monety em aplicações React Native. Oferece Analytics, Feature Flags, Paywalls dinâmicas e gerenciamento de In-App Purchases.

Instalação

npm install @monety/sdk-react-native

Peer Dependencies

O SDK requer as seguintes dependências instaladas no seu projeto:

npm install @react-native-async-storage/async-storage @react-native-community/netinfo react-native-iap react-native-device-info

Persistência de Device ID (Recomendado)

Para melhor persistência do device ID entre reinstalações do app (especialmente no iOS), instale também:

npm install react-native-keychain

Esta dependência é opcional, mas altamente recomendada. Com ela:

  • iOS: Device ID persiste no Keychain mesmo após desinstalar o app
  • Android: Device ID é armazenado de forma segura no Keystore

Sem ela, o SDK usa AsyncStorage como fallback (funciona, mas não persiste após desinstalação).

Para iOS:

cd ios && pod install

Quick Start

1. Configure o Provider

import { PanelProvider } from '@monety/sdk-react-native';

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

2. Use os Hooks

import { usePanel, useSubscription } from '@monety/sdk-react-native';

function MyComponent() {
  const { presentPaywall, hasActiveSubscription } = usePanel();
  const { subscription } = useSubscription();

  const handlePurchase = async () => {
    const hasAccess = await hasActiveSubscription();
    if (!hasAccess) {
      await presentPaywall('default');
    }
  };

  return (
    <Button onPress={handlePurchase}>
      {subscription ? 'Premium' : 'Upgrade'}
    </Button>
  );
}

API Principal

PanelProvider

Provider que inicializa o SDK e disponibiliza o contexto para toda a aplicação.

<PanelProvider config={PanelConfig}>
  {children}
</PanelProvider>

usePanel()

Hook principal com acesso a todas as funcionalidades:

  • isInitialized - Se o SDK foi inicializado
  • distinctId - ID único do usuário
  • presentPaywall(placement) - Apresenta uma paywall
  • hasActiveSubscription() - Verifica se há assinatura ativa
  • getSubscription() - Obtém dados da assinatura
  • restorePurchases() - Restaura compras anteriores

useSubscription()

Hook para gerenciamento de assinaturas:

  • subscription - Dados da assinatura atual
  • isLoading - Estado de carregamento
  • refresh() - Atualiza dados da assinatura

Panel (API Imperativa)

Para uso fora de componentes React:

import { Panel } from '@monety/sdk-react-native';

// Identificar usuário
await Panel.identify('user_123', { email: '[email protected]' });

// Rastrear evento
await Panel.track('purchase_completed', { product: 'premium' });

// Feature Flags
const variant = await Panel.getVariant('new_feature');

Tipos

interface PanelConfig {
  appKey: string;
  baseUrl?: string;
  debug?: boolean;
  environment?: 'Production' | 'Sandbox';
}

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

interface PaywallResult {
  presented: boolean;
  purchased: boolean;
  restored: boolean;
  cancelled: boolean;
  error?: Error;
}

Suporte

Para dúvidas ou problemas, entre em contato com o suporte Monety.

Licença

MIT