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

@influto/react-native-sdk

v1.3.1

Published

InfluTo SDK for React Native - Track influencer referrals and conversions

Readme

InfluTo React Native SDK

Track influencer referrals and conversions in your React Native app.

Prerequisites

You need a free InfluTo account to use this SDK.

  1. Sign up at https://influ.to (free)
  2. Create your app in the dashboard
  3. Copy your API key from Settings → API Keys

Your API key starts with it_ (e.g., it_abc123...)

Installation

npm install @influto/react-native-sdk
# or
yarn add @influto/react-native-sdk

Peer Dependencies:

npm install @react-native-async-storage/async-storage

Quick Start

1. Initialize SDK

import InfluTo from '@influto/react-native-sdk';

// In your App.js or root component
await InfluTo.initialize({
  apiKey: 'it_abc123...',  // Get from InfluTo dashboard
  debug: __DEV__  // Enable logging in development
});

2. Check Attribution

// During onboarding, check if user came from a referral
const attribution = await InfluTo.checkAttribution();

if (attribution.attributed) {
  console.log('User came from:', attribution.referralCode);

  // Show trial or special offer
  showTrialPaywall(attribution.referralCode);
} else {
  // Organic user - show regular paywall
  showRegularPaywall();
}

3. Identify User

// After user completes onboarding or you have their ID
await InfluTo.identifyUser('revenuecat_user_id_123');

4. Track Events (Optional)

// Track key events for analytics
await InfluTo.trackEvent({
  eventType: 'trial_started',
  appUserId: 'revenuecat_user_id_123',
  properties: {
    trial_days: 7,
    product_id: 'monthly_subscription'
  }
});

Complete Integration Example

import React, { useEffect, useState } from 'react';
import InfluTo from '@influto/react-native-sdk';
import Purchases from 'react-native-purchases';

function App() {
  const [hasReferral, setHasReferral] = useState(false);
  const [referralCode, setReferralCode] = useState(null);

  useEffect(() => {
    async function setupInfluTo() {
      // 1. Initialize InfluTo
      await InfluTo.initialize({
        apiKey: 'it_abc123...',
        debug: __DEV__
      });

      // 2. Check attribution
      const attribution = await InfluTo.checkAttribution();

      if (attribution.attributed) {
        setHasReferral(true);
        setReferralCode(attribution.referralCode);

        // 3. Store in RevenueCat for webhook attribution
        await Purchases.setAttributes({
          'influto_code': attribution.referralCode
        });
      }

      // 4. Identify user when available
      const customerInfo = await Purchases.getCustomerInfo();
      await InfluTo.identifyUser(customerInfo.originalAppUserId);
    }

    setupInfluTo();
  }, []);

  // Show appropriate paywall based on attribution
  const showPaywall = async () => {
    const offerings = await Purchases.getOfferings();

    if (hasReferral) {
      // Show trial offering
      const trialOffering = offerings.all['trial'] || offerings.current;
      await RevenueCatUI.presentPaywall({ offering: trialOffering });

      // Track event
      await InfluTo.trackEvent({
        eventType: 'trial_paywall_shown',
        appUserId: customerInfo.originalAppUserId,
        properties: { influto_code: referralCode }
      });
    } else {
      // Show regular offering
      await RevenueCatUI.presentPaywall();
    }
  };

  return (
    <YourApp hasReferral={hasReferral} onShowPaywall={showPaywall} />
  );
}

API Reference

InfluTo.initialize(config)

Initialize the SDK. Call once when app starts.

Parameters:

  • config.apiKey (required): Your API key from InfluTo dashboard
  • config.debug (optional): Enable debug logging (defaults to false)

Returns: Promise<void>

InfluTo.checkAttribution()

Check if user was referred by an influencer.

Returns: Promise<AttributionResult>

Example:

const result = await InfluTo.checkAttribution();
// { attributed: true, referralCode: 'FITGURU25', clickedAt: '2025-12-01T10:30:00Z' }

InfluTo.identifyUser(appUserId, properties?)

Identify user with their app user ID.

Parameters:

  • appUserId (required): RevenueCat ID or your custom user ID
  • properties (optional): Additional user properties

Returns: Promise<void>

InfluTo.trackEvent(options)

Track custom analytics event.

Parameters:

  • options.eventType (required): Event name
  • options.appUserId (required): User ID
  • options.properties (optional): Event properties
  • options.referralCode (optional): Associated referral code

Returns: Promise<void>

InfluTo.getActiveCampaigns()

Get list of active campaigns for this app.

Returns: Promise<Campaign[]>

InfluTo.getReferralCode()

Get stored referral code (if any).

Returns: Promise<string | null>

InfluTo.clearAttribution()

Clear stored attribution data (useful for testing).

Returns: Promise<void>

Integration with RevenueCat

InfluTo works seamlessly with RevenueCat:

  1. Store referral code in RevenueCat attributes:
const attribution = await InfluTo.checkAttribution();
if (attribution.attributed) {
  await Purchases.setAttributes({
    'influto_code': attribution.referralCode
  });
}
  1. Configure RevenueCat webhook in InfluTo dashboard

  2. InfluTo automatically tracks subscription events and calculates commissions

Platform Support

  • ✅ iOS 13.0+
  • ✅ Android 5.0+ (API level 21+)
  • ✅ Expo (managed & bare workflows)

Troubleshooting

Attribution not working?

  • Ensure you called initialize() before checkAttribution()
  • Check API key is correct
  • Verify app is configured in InfluTo dashboard
  • Check network connectivity

User not identified?

  • Make sure you call identifyUser() after user completes onboarding
  • Verify user ID matches what RevenueCat sends in webhooks

Promo Code Integration

InfluTo supports manual promo code entry for users who hear about codes via social media, podcasts, or word-of-mouth.

Quick Example (Pre-built UI)

import { ReferralCodeInput } from '@influto/react-native-sdk/ui';

<ReferralCodeInput
  onValidated={(result) => {
    if (result.valid) {
      navigation.navigate('Paywall');
    }
  }}
  onSkip={() => navigation.navigate('Paywall')}
/>

Quick Example (Headless)

import InfluTo from '@influto/react-native-sdk';

// User enters code
const result = await InfluTo.applyCode('FITGURU30', userId);

if (result.valid && result.applied) {
  // Code is validated AND set in RevenueCat automatically
  showPaywall(result.campaign);
}

📚 Complete Promo Code Guide - Examples, customization, best practices


New in v1.1.0

Manual promo code entry - Users can type codes in your app ✅ Pre-built UI component - <ReferralCodeInput /> with full customization ✅ Headless API - Build your own UI with validateCode(), setReferralCode(), applyCode()Auto-prefill - Automatically fills code if user came via link ✅ Custom callbacks - React to validation results ✅ Full internationalization - Customize all labels and messages


Support

  • Documentation: https://docs.influ.to
  • Help Center: https://influ.to/help
  • Email: [email protected]

License

MIT © InfluTo