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

appfiliate-react-native

v1.0.0

Published

Lightweight install attribution for mobile app affiliate marketing

Readme

Appfiliate React Native SDK

Lightweight install attribution for mobile app affiliate marketing. Pure JavaScript/TypeScript -- no native modules required.

Installation

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

AsyncStorage is a peer dependency used for persisting attribution state across app launches.

Quick Start

import { appfiliate } from 'appfiliate-react-native';

// 1. Configure once on app startup
appfiliate.configure({ appId: 'APP_ID_HERE', apiKey: 'API_KEY_HERE' });

// 2. Track install (safe to call every launch -- only runs once)
const result = await appfiliate.trackInstall();
console.log('Attributed:', result.matched);

Your appId and apiKey are available in your Appfiliate dashboard.

Track Purchases

Call after every successful in-app purchase:

await appfiliate.trackPurchase({
  productId: 'premium_monthly',
  revenue: 9.99,
  currency: 'USD',
  transactionId: 'txn_123',
});

Link a User ID

If you use RevenueCat or another subscription platform, link the user ID so server-side webhooks can attribute purchases automatically:

await appfiliate.setUserId(Purchases.appUserID);

Check Attribution

Synchronous getters are available after trackInstall() completes:

appfiliate.isAttributed;  // boolean
appfiliate.attributionId; // string | null

API Reference

appfiliate.configure(opts)

| Parameter | Type | Required | Description | |-----------|----------|----------|---------------------------------| | appId | string | Yes | Your app ID from the dashboard | | apiKey | string | Yes | Your API key from the dashboard |

appfiliate.trackInstall()

Returns Promise<AttributionResult>:

interface AttributionResult {
  matched: boolean;
  attributionId: string | null;
  confidence: number;
  method: string;
  clickId: string | null;
}

appfiliate.trackPurchase(opts)

| Parameter | Type | Required | Default | Description | |---------------|--------|----------|---------|-----------------------| | productId | string | Yes | | Product identifier | | revenue | number | Yes | | Purchase amount | | currency | string | No | "USD" | ISO 4217 currency | | transactionId | string | No | | Platform transaction |

appfiliate.setUserId(userId: string)

Links an external user ID to the attribution.

appfiliate.isAttributed

boolean -- whether this install was attributed to a creator.

appfiliate.attributionId

string | null -- the attribution ID, or null if not attributed.

How It Works

The SDK collects non-identifying device signals (screen size, timezone, language, OS version) and sends them to the Appfiliate API for probabilistic fingerprint matching against recent link clicks. No IDFA, no ATT prompt, no native modules.

Requirements

  • React Native 0.72+
  • iOS 15+ / Android 5.0+

License

MIT