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

insightpro-ai-sdk-react-native

v1.0.0

Published

InsightPro React Native SDK for mobile event tracking

Readme

InsightPro React Native SDK

Mobile event tracking SDK for React Native (iOS & Android).

Features

  • Auto-tracking: Screen views and app lifecycle events
  • Session Management: Automatic session tracking with timeout
  • Event Batching: Efficient batching and buffering
  • Offline Support: Events queued when offline
  • Device Info: Automatic device and platform metadata
  • TypeScript Support: Full TypeScript definitions
  • React Navigation Integration: Automatic screen tracking

Installation

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

iOS

cd ios && pod install

Android

No additional steps required.

Quick Start

Initialize SDK

import InsightPro from '@insightpro/sdk-react-native';

const analytics = new InsightPro({
  endpoint: 'https://api.insightpro.com',
  tenantId: 'your-tenant-id',
  apiKey: 'your-api-key', // Optional
  debug: __DEV__, // Enable debug logs in development
});

Track Events

Screen Views

// Manual screen tracking
analytics.trackScreenView('Home', {
  category: 'main',
});

// With React Navigation
import { useNavigationContainerRef } from '@react-navigation/native';

const navigationRef = useNavigationContainerRef();

<NavigationContainer
  ref={navigationRef}
  onStateChange={() => {
    const currentRoute = navigationRef.getCurrentRoute();
    analytics.trackScreenView(currentRoute?.name || 'Unknown');
  }}
>
  {/* Your screens */}
</NavigationContainer>

E-commerce

// Product view
analytics.trackEcommerce({
  action: 'view_item',
  productId: 'prod-123',
  productName: 'Awesome Product',
  price: 99.99,
  currency: 'USD',
});

// Purchase
analytics.trackEcommerce({
  action: 'purchase',
  orderId: 'order-456',
  revenue: 199.98,
  currency: 'USD',
});

User Actions

analytics.trackAction('button_press', {
  buttonName: 'Subscribe',
  screen: 'Home',
});

Errors

try {
  // Your code
} catch (error) {
  analytics.trackError(error.message, {
    stack: error.stack,
    level: 'error',
  });
}

User Identification

// After login
analytics.identify('user-123', {
  email: '[email protected]',
  name: 'John Doe',
  plan: 'premium',
});

// After logout
analytics.reset();

React Navigation Integration

import { NavigationContainer } from '@react-navigation/native';
import { useNavigationContainerRef } from '@react-navigation/native';

function App() {
  const navigationRef = useNavigationContainerRef();
  const routeNameRef = useRef<string>();

  return (
    <NavigationContainer
      ref={navigationRef}
      onReady={() => {
        routeNameRef.current = navigationRef.getCurrentRoute()?.name;
      }}
      onStateChange={async () => {
        const previousRouteName = routeNameRef.current;
        const currentRouteName = navigationRef.getCurrentRoute()?.name;

        if (previousRouteName !== currentRouteName) {
          analytics.trackScreenView(currentRouteName || 'Unknown', {
            previousScreen: previousRouteName,
          });
        }

        routeNameRef.current = currentRouteName;
      }}
    >
      {/* Your navigation stack */}
    </NavigationContainer>
  );
}

Configuration Options

{
  /** API endpoint URL (required) */
  endpoint: string;

  /** Tenant ID (required) */
  tenantId: string;

  /** API key for authentication (optional) */
  apiKey?: string;

  /** Enable debug logging (default: false) */
  debug?: boolean;

  /** Batch size for event buffering (default: 10) */
  batchSize?: number;

  /** Batch interval in milliseconds (default: 5000) */
  batchInterval?: number;

  /** Enable automatic screen view tracking (default: true) */
  autoTrackScreenViews?: boolean;

  /** Enable session tracking (default: true) */
  enableSessions?: boolean;

  /** Session timeout in milliseconds (default: 30 minutes) */
  sessionTimeout?: number;

  /** Custom properties to include with every event */
  globalProperties?: Record<string, any>;

  /** Retry failed requests (default: true) */
  retryFailedRequests?: boolean;

  /** Maximum retry attempts (default: 3) */
  maxRetries?: number;
}

Device Information

The SDK automatically collects:

  • Device ID (persisted across app launches)
  • Platform (iOS/Android)
  • OS Version
  • App Version
  • Device Manufacturer
  • Device Model
  • Locale

Offline Support

Events are automatically queued when the device is offline and sent when connectivity is restored.

TypeScript Support

Full TypeScript definitions are included:

import InsightPro, {
  InsightProConfig,
  EcommerceEvent,
} from '@insightpro/sdk-react-native';

const config: InsightProConfig = {
  endpoint: 'https://api.insightpro.com',
  tenantId: 'your-tenant-id',
  debug: true,
};

const analytics = new InsightPro(config);

License

MIT