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

react-native-pixalate-collect

v1.0.0

Published

React Native package for Pixalate data collection - compatible with both React Native CLI and Expo

Readme

react-native-pixalate-collect

A React Native package for Pixalate data collection that works with both React Native CLI and Expo.

Features

  • ✅ Compatible with React Native CLI and Expo
  • ✅ Automatic session and visitor tracking
  • ✅ Geolocation support (with fallback)
  • ✅ Persistent storage using AsyncStorage
  • ✅ TypeScript support
  • ✅ Component and Hook APIs

Installation

For Expo projects:

npx expo install @react-native-async-storage/async-storage expo-location

For React Native CLI projects:

npm install @react-native-async-storage/async-storage @react-native-community/geolocation
# or
yarn add @react-native-async-storage/async-storage @react-native-community/geolocation

# For iOS
cd ios && pod install && cd ..

Install the package:

If using as a local package:

npm install ./react-native-pixalate-collect
# or
yarn add ./react-native-pixalate-collect

Usage

Using the Component

import React from 'react';
import { PixalateCollect } from 'react-native-pixalate-collect';

export default function App() {
  return (
    <>
      <PixalateCollect
        networkcode="23269931309"
        partnerId="n/a"
        current_domain="http://sorbet-supply.test"
        clientId="ask.askaianything.ai"
        onSuccess={(payload) => console.log('Data sent:', payload)}
        onError={(error) => console.error('Error:', error)}
      />
      {/* Your app content */}
    </>
  );
}

Using the Hook

import React from 'react';
import { usePixalateCollect } from 'react-native-pixalate-collect';

export default function MyScreen() {
  const { collectData } = usePixalateCollect({
    networkcode: "23269931309",
    partnerId: "n/a",
    current_domain: "http://sorbet-supply.test",
    clientId: "ask.askaianything.ai",
    pageUri: "app://my-screen",
    autoCollect: true, // Automatically collect on mount
    onSuccess: (payload) => console.log('Data sent:', payload),
    onError: (error) => console.error('Error:', error),
  });

  // Manually trigger collection
  const handleButtonPress = () => {
    collectData('app://custom-page');
  };

  return (
    // Your component JSX
  );
}

Props/Config

PixalateCollect Component Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | networkcode | string | Yes | - | Network code | | partnerId | string | No | "n/a" | Partner ID | | current_domain | string | Yes | - | API endpoint domain | | clientId | string | No | "ask.askaianything.ai" | Client ID | | onError | (error: Error) => void | No | - | Error callback | | onSuccess | (payload: any) => void | No | - | Success callback |

usePixalateCollect Hook Config

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | networkcode | string | Yes | - | Network code | | partnerId | string | No | "n/a" | Partner ID | | current_domain | string | Yes | - | API endpoint domain | | clientId | string | No | "ask.askaianything.ai" | Client ID | | pageUri | string | No | "app://main" | Page URI | | autoCollect | boolean | No | true | Auto collect on mount | | onError | (error: Error) => void | No | - | Error callback | | onSuccess | (payload: any) => void | No | - | Success callback |

Hook Return Value

| Method | Type | Description | |--------|------|-------------| | collectData | (customPageUri?: string) => Promise<void> | Manually trigger data collection |

Permissions

iOS (Info.plist)

For React Native CLI, add to ios/YourApp/Info.plist:

<key>NSLocationWhenInUseUsageDescription</key>
<string>We need your location to provide better analytics</string>

For Expo, add to app.json:

{
  "expo": {
    "ios": {
      "infoPlist": {
        "NSLocationWhenInUseUsageDescription": "We need your location to provide better analytics"
      }
    }
  }
}

Android (AndroidManifest.xml)

For React Native CLI, add to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

For Expo, add to app.json:

{
  "expo": {
    "android": {
      "permissions": [
        "ACCESS_FINE_LOCATION",
        "ACCESS_COARSE_LOCATION"
      ]
    }
  }
}

Data Collected

The package collects and sends the following data:

  • browserAgent: User agent string
  • clientId: Client identifier
  • networkcode: Network code
  • partnerId: Partner ID
  • pageUri: Current page URI
  • sessionId: Session identifier
  • sessionTime: Session timestamp
  • visitorId: Visitor identifier (persists for 365 days)
  • visitorTime: Visitor timestamp
  • supplyType: Always "Mobile_Web" for React Native
  • mobileLatitude: Device latitude (if permission granted)
  • mobileLongitude: Device longitude (if permission granted)

Notes

  • Session data persists until app is uninstalled or cleared
  • Visitor data persists for 365 days
  • Location is optional and will be null if permission is denied
  • The package automatically handles both Expo and React Native CLI location APIs
  • If location permissions are not granted, the package will still send data without location

License

MIT